Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 172
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 172
Default 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
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
Lookup and Change Values Jeff Gross Excel Worksheet Functions 3 March 20th 08 03:16 PM
V Lookup Not working since change Pammi J Excel Discussion (Misc queries) 3 July 13th 07 11:04 AM
How to change lookup references Guy Yeakley Excel Worksheet Functions 1 January 25th 06 02:24 PM
Lookup and Change rollover99 via OfficeKB.com Excel Worksheet Functions 2 December 30th 05 01:17 AM
LOOKUP: change referenced spreadsheet Barb Excel Discussion (Misc queries) 5 November 2nd 05 12:08 AM


All times are GMT +1. The time now is 03:39 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"