Steven has attended:
Excel VBA Intro Intermediate course
Changing the pathway of a vlookup
I recorded a macro that has a vlookup to another workbook.
The workbook has been moved to another folder and so when running the macro the screen to select the destination pathway pops up.
In the code it appears as:
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R[1]C[1],'[CONTRACT LIST.xls]Sheet1'!R2C1:R12C2,2,FALSE)"
It is the workbook "contract list" that has changed location.
Is there a simple way to change where its looking in the code?
RE: Changing the pathway of a vlookup
Hi Steven
The below formula would pint to a file that was located on the desktop.
"=VLOOKUP(R[1]C[1],'C:\WINDOWS\Desktop\[CONTRACT
LIST.xls]Sheet1'!R2C1:R12C2,2,FALSE)"
Just added
'C:\WINDOWS\Desktop\
to the front of the sheet name.
Depending on the location, the address would differ.
Regards
Richard