Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change value after lookup
I have two worksheets in my file. I have a value in sheet1 in cell AN2 that I
need to lookup on sheet2 in column AF. When it finds a match I then need to change the value in column N on Sheet2 for the row it found the value in. How can I write vba code to fire this code? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change value after lookup
Assuming you want the code to run when the user changes the Sheet1!AN2 cell value, you will probably want to use Sheet1's Worksheet_Change event. Take a look at the help files and see if that looks like it will work - you'll need to check if the Target range in that event is AN2 (possibly by comparing the Target.Address with "AN2" = or "$AN$2" - check which format the Target.Address returns) and run your code if it is or exit the sub if the change wasn't in AN2. -- jamescox ------------------------------------------------------------------------ jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=111601 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Change value after lookup
Do you mean look at the help file for the Worksheet Change Event?
"jamescox" wrote: Assuming you want the code to run when the user changes the Sheet1!AN2 cell value, you will probably want to use Sheet1's Worksheet_Change event. Take a look at the help files and see if that looks like it will work - you'll need to check if the Target range in that event is AN2 (possibly by comparing the Target.Address with "AN2" = or "$AN$2" - check which format the Target.Address returns) and run your code if it is or exit the sub if the change wasn't in AN2. -- jamescox ------------------------------------------------------------------------ jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=111601 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Lookup and Change Values | Excel Worksheet Functions | |||
V Lookup Not working since change | Excel Discussion (Misc queries) | |||
How to change lookup references | Excel Worksheet Functions | |||
Lookup and Change | Excel Worksheet Functions | |||
LOOKUP: change referenced spreadsheet | Excel Discussion (Misc queries) |