crobinson661
New Member
- Joined
- Nov 15, 2019
- Messages
- 11
Hate to bump, but I'm stuck.....
I posted Friday, but with 56 views, I'm the only post without a reply through Sunday, so I'll try to parse my inquiry.
VLOOKUP Macro Workbook Reference Variable
This IFNA(VLOOKUP attempts to reference another workbook opened earlier in the Macro. I think my syntax is wrong, I've tried several variations and cannot figure out how it's wrong.
Most recently, I am getting "Run Time error 438: Object doesn't support this property or method"
Here's the code that opens the file:
Thanks for any suggestions
I posted Friday, but with 56 views, I'm the only post without a reply through Sunday, so I'll try to parse my inquiry.
VLOOKUP Macro Workbook Reference Variable
VBA Code:
Range("J2").FormulaR1C1 = _
"=IFNA(VLOOKUP(RC[-5],[" & wkb3 & "]!C5:C9,5,0),"""")"
Range("J2").Select
Selection.AutoFill Destination:=Range("J2:J80")
Range("J2:J80").Select
This IFNA(VLOOKUP attempts to reference another workbook opened earlier in the Macro. I think my syntax is wrong, I've tried several variations and cannot figure out how it's wrong.
Most recently, I am getting "Run Time error 438: Object doesn't support this property or method"
Here's the code that opens the file:
VBA Code:
FileDate = Format(Date - 1, "DD-MMM-YYYY")
FilePath = "V:\ParentDirectory\Folder1\Folder2\Folder3\Folder4 " & FileDate & ".csv"
Dim wkb As Workbook
Set wkb = ActiveWorkbook
Dim wkb2 As Workbook
Set wkb2 = Workbooks.Open("V:\ParentDirectory\Folder1\Folder2\ProductPriceFile.xlsx")
Dim wkb3 As Workbook
Set wkb3 = Workbooks.Open(FilePath)
Thanks for any suggestions