Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
James Cornthwaite
 
Posts: n/a
Default My first macro, uses Vlookup but doesnt update unless hit enter

I have written the macro (my first!) as below

Function FindOldNominal(NomCode)

FindOldNominal = WorksheetFunction.VLookup(NomCode, range("IMPORTRANGE"), 5,
false)
End Function




This works fine... except..


If I alter the value in the defined range "ImportRange" say from 10 to 20
at nomcode X then

FindOldNominal(X) still says 10, unless I go into the cell where the
formula call of '=FindOldNominal(X)' is and press enter again.

My question is I would like it to update it self automatically like the sum
function "=sum" does. Is there a reason why this macro isn't or are all
macros like this.
Is there a way round it if this is the case.


Many thanks in anticipation

James


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default My first macro, uses Vlookup but doesnt update unless hit enter

see response in programming

--
HTH

Bob Phillips

(replace xxxx in email address with googlemail if mailing direct)

"James Cornthwaite" wrote in message
...
I have written the macro (my first!) as below

Function FindOldNominal(NomCode)

FindOldNominal = WorksheetFunction.VLookup(NomCode, range("IMPORTRANGE"),

5,
false)
End Function




This works fine... except..


If I alter the value in the defined range "ImportRange" say from 10 to 20
at nomcode X then

FindOldNominal(X) still says 10, unless I go into the cell where the
formula call of '=FindOldNominal(X)' is and press enter again.

My question is I would like it to update it self automatically like the

sum
function "=sum" does. Is there a reason why this macro isn't or are all
macros like this.
Is there a way round it if this is the case.


Many thanks in anticipation

James




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
How can I automatically update column index number in VLookup whe. Gene Excel Worksheet Functions 2 July 10th 12 11:23 AM
how do I enter data labels for a bar chart and get them to update drpixel Charts and Charting in Excel 1 January 1st 06 01:26 PM
WHY DO I HAVE TO CLICK ON THE CELL & ENTER FOR THE VLOOKUP TOWORK Half Manx Excel Discussion (Misc queries) 4 September 29th 05 12:12 PM
excel macro to update visio orgchart Anna Excel Discussion (Misc queries) 0 April 29th 05 11:38 AM
enter a new value into a cell using macro in excel cath Excel Discussion (Misc queries) 2 April 12th 05 11:32 PM


All times are GMT +1. The time now is 07:37 PM.

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

About Us

"It's about Microsoft Excel"