sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,404
- Office Version
- 2016
- Platform
- Windows
I'm trying to write a Vlookup worksheet function to get the values from a worksheet that's formatted as Table View but I keep getting a run-time error 1004. If I use this on a normal worksheet it works fine though. Can anyone help me understand why please?
VBA Code:
LastRow = Sheet2.Range("A65536").End(xlUp).Row
LastCRRow = Sheet4.Range("A65536").End(xlUp).Row
LookupRng = Sheet4.Range("A2:J" & LastCRRow)
For Each Cell In Sheet2.Range("I2:I" & LastRow)
Cell = WorksheetFunction.VLookup(Cell, LookupRng, 4, False)