D
Dale Fye
I'm an Access programmer, venturing into Excel VBA.
I have a form that contains a text value ("1.1.6") that is one of many
values in my TaskInfo Worksheet. I want to use Vlookup to get the values in
the 2nd, 3rd, and 4th columns of this worksheet, but cannot seem to make it
work. My code segment looks like:
Dim lookupRange as range
set lookupRange = Worksheets("TaskInfo").Range("A2:A200")
me.text2.Value = application.worksheetfunction.vlookup("1.1.6", lookupRange,
2)
But this generates a runtime error 1004:
Unable to get the Vlookup property of the WorksheetFunction class
When set the lookupRange in the Immediate window, I am able to debug.print
lookupRange(1), etc, so I know the range is defined properly, but have know
idea why I am getting this error message.
Any help would be greatly appreciated.
I have a form that contains a text value ("1.1.6") that is one of many
values in my TaskInfo Worksheet. I want to use Vlookup to get the values in
the 2nd, 3rd, and 4th columns of this worksheet, but cannot seem to make it
work. My code segment looks like:
Dim lookupRange as range
set lookupRange = Worksheets("TaskInfo").Range("A2:A200")
me.text2.Value = application.worksheetfunction.vlookup("1.1.6", lookupRange,
2)
But this generates a runtime error 1004:
Unable to get the Vlookup property of the WorksheetFunction class
When set the lookupRange in the Immediate window, I am able to debug.print
lookupRange(1), etc, so I know the range is defined properly, but have know
idea why I am getting this error message.
Any help would be greatly appreciated.