I am attempting to create an add-in with a VLOOKUP from a range on the add-in sheet. This is too long to do with case (3000+ lines) and I don't want to have to have the user store this file.
Function WSort(strng)
Dim DivR, wb1 As Workbook, ws1 As Worksheet
Set wb1 = ThisWorkbook
Set ws1 = wb1.Sheets("HEA")
strng = Left(strng, 5)
WSort = Application.WorksheetFunction.VLookup(RetStr, ws1.Range("C2:D4000"), 2, False)
End Function
I have tried writing this several ways and I keep running into the issue that I cant reliably reference the HEA Tab. I have tried using Sheet3 and Sheets(4).