Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I am getting an "Unable to get the Vlookup property of the WorksheetFunction class " error with the line in red below. This code opens the file (2021) Sunset.xlsx from the specified path and applies a vblookup function to compare the value tm (a true date) to the values in column 1 of the worksheet Sunset in the file opened by GetObject. Column 1 contains true date values. In testing for example, tm = 2021-06-20. There is a match at cell A112 (2020-06-20)
Rich (BB code):
With GetObject("D:/WSOP 2020/SupportData/(2021)Sunset.xlsx")
Set Range1 = .Sheets("Sunset").Range("A:D")
tm = ws_cdata.Cells(pebftp, 1).Value
ssoff = Application.WorksheetFunction.VLookup(tm, Range1, 4, False)
.Close
End With