98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » excel vba - Changing the pathway of a vlookup
excel vba - Changing the pathway of a vlookup
Resolved · Low Priority · Version Standard
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
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Applying and removing border from cell in Excel 2010Did you know the shortcut key for applying and removing the outline border for a cell? |