Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
hi,
I have 2 sheets in my workbook, sheet 1 contains the main analysis of my data sheet 2 contains a table which I will reference with VLOOKUP from sheet 1 I have written the following VBA code for my purpose: Worksheets(1).Activate //activate sheet 1 Range("M2").FormulaR1C1 = "=VLOOKUP(RC[-5], lookuptable'!$A2:$B38, 2, false)" //input into cell M2 of sheet 1 this formula. when I run my code, cell M2 in sheet 1 will give a #NAME? error and when I look at the formula in the cell: =VLOOKUP(H2,personal.xls!'A2':'B38',2,FALSE) notice the extra single quotes around A2 and B38. ps: i defined my module in personal.xls to be able to access it from any workbook. thnks. Michael. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
vlookup and filename returning same result on each sheet. | Excel Discussion (Misc queries) | |||
Copying multiple sheets from one book 2 another and undertake spec | Excel Discussion (Misc queries) | |||
vlookup...transferring info from 1 sheet to another.... | Excel Worksheet Functions | |||
vlookup with data on more than one sheet | Excel Worksheet Functions | |||
Naming & renaming a sheet tab | Excel Worksheet Functions |