LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Macro lookup is not working good?

Hi...

In order to save me a lot of time im working on a macro that looks up a
value i typed in a specific cell and returns a different value next to the
cell that has the same value as i typed in. For example: my sheet looks like
this

Col. B C D E

Activity ID 33 9221
2
1
0005 2
0006 4
0007 6
3
1
9000 2
9001 9
9010 11
9011 22
24
9120 25
9120 26
9121 28
30
9220 31
9221 33
9230 35
9231 41
9270 43
9271 49
51
9510 52

I made a VLOOKUP formula that does the job (=VLOOKUP(E1,B1:C264,2,0)
As you van see in the example that when i type 9221 in column E it returns
33 in column D. Thats perfect and what i want BUT the sheet is so very big
and the data that i have to match is even bigger. So i started working on a
macro that returns me the value in exact the same cell as were i typed in the
reference, here is the macro:

Private Sub Worksheet_Change(Target As Range)
If Target.Address < "$C$2" Then Exit Sub
Application.EnableEvents = False
On Error Resume Next
Target = Columns(2).Find(Target).Offset(, 1)
Application.EnableEvents = True
End Sub

What i want is to type in a value anywere in column D or E or F and return
the value that is in column C. So when i type in D5 (for example) 9011 it
must return 22. Can anyone please help me with the macro???

Thanks
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
Why have my Excel Macro Shortcuts stopped working? Mac Excel Worksheet Functions 0 November 6th 05 12:42 AM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Insert Row macro not working Acct Supr - DCTC Excel Discussion (Misc queries) 3 October 7th 05 01:11 AM
Macro "1 tall/1 wide" not working properly gizmo Excel Worksheet Functions 2 January 10th 05 07:18 PM


All times are GMT +1. The time now is 10:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"