Using: Excel 2010
I'm trying to code a VBA proc to lookup a filename from the 2nd column in an Excel Table (ideally I would prefer to look this value up based on the Header Label and not based on an index, in case columns are subsequently added), based on a lookup value which corresponds to the value in the 1st column.
Referring to the image below, i'm trying to do something like:
lookupval = "007"
fileNm = Application.WorksheetFunct
l, Sheet1.Range("Table1"), 2, False)
where I'm assuming that the third argument in VLookup is an offset from the lookupval column, which would cause the value under column "Filename" to be assigned to 'fileNm'
In my example, given lookupval = "007", I would want to retrieve fileNm = "someotherfilename.pdf" and then open that file in Acrobat Reader.
I'm not clear on the syntax. I presently get the following MS Visual Basic run-time error '1004':
"Unable to get the VLookup property of the function Worksheet class"
Your help is appreciated.