Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveCell.FormulaR1C1 = _
"=VLOOKUP (RC[-67], '" & _ TwoMonthsAgo & "'!C[-67],68,FALSE)" -- Regards, Tom Ogilvy "Tony" wrote in message ... When I run my macro it opens a file and inserts a new sheet named with the month and year for last month "Aug04". In this sheet I want to do a vlookup into the previous months sheet for some information. I have a variable set to store the previous month and year but I am not sure how to use this variable in my line of code. The way I have it now is as follows: ActiveCell.FormulaR1C1 = _ "=VLOOKUP (RC[-67], 'Jul04'!C[-67],68,FALSE)" It works just fine if I specifically say to look at sheet < 'Jul04' but I want it to be automated to use my variable < TwoMonthsAgo . Thank you for any suggestions. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VLookup Variable Offset | Excel Discussion (Misc queries) | |||
Vlookup using a variable for the workbook name | Excel Discussion (Misc queries) | |||
set a variable based on a vlookup | Excel Discussion (Misc queries) | |||
Variable col_index_num in vlookup | Excel Discussion (Misc queries) | |||
variable vlookup | Excel Programming |