I hope you can help.
I’m trying to write VBA code for a vlookup formula that contains 4 variables and collections/objects.
Essentially, I need it to do this:
Workbooks(‘a’).Worksheets("Provider Report").Range(‘b’ & "9").Formula = "=VLOOKUP($a9, ‘[workbooks(‘c’)]Worksheets(‘d’) '!$A:$J,9,0)"
Where
Here's my latest stab at it:
Workbooks(txtMacroFile).Worksheets("Provider Disruption Report").Range(txtCoLetter & "9").Formula = _
"=VLOOKUP(a9,'[workbooks(txtExportfilename).Worksheets(PPO_WSN)] '!$A:$j,9,0)"
While this code runs, a file selection dialog appears asking me to “Update Values workbooks(txtTAwbNm).worksheets(intWSNum.”
Thanks in advance for any guidance or solutions you can offer.
I’m trying to write VBA code for a vlookup formula that contains 4 variables and collections/objects.
Essentially, I need it to do this:
Workbooks(‘a’).Worksheets("Provider Report").Range(‘b’ & "9").Formula = "=VLOOKUP($a9, ‘[workbooks(‘c’)]Worksheets(‘d’) '!$A:$J,9,0)"
Where
- ‘a’ = name of file that needs the vlookup
- ‘b’ = column letter of the first available column
- ‘c’ = the name of the workbook with the table array
- ‘d’ = the worksheet number that contains the table array
- ‘a’ to txtMacrofile
- ‘b’ to txtColLetter
- ‘c’ to txtTAwbNm
- ‘d’ to intWSNum
Here's my latest stab at it:
Workbooks(txtMacroFile).Worksheets("Provider Disruption Report").Range(txtCoLetter & "9").Formula = _
"=VLOOKUP(a9,'[workbooks(txtExportfilename).Worksheets(PPO_WSN)] '!$A:$j,9,0)"
While this code runs, a file selection dialog appears asking me to “Update Values workbooks(txtTAwbNm).worksheets(intWSNum.”
Thanks in advance for any guidance or solutions you can offer.