abalakrishnan2010
New Member
Hi,
I am new to VBA programming, please help me to resolve the below question.
I have attached the excel file.
Form the attached excel, if I select the d1 cell, after run the below code it should give the result as "Feb16\", but I got an error
" Run-time error '1004': Unable to get the VLookup property of the Worksheetfuntion class ",
But if I select the "d2" cell, I got the result as "Apr16\".
I don't know why this error is coming.
The below is my code:
Sub OpenCatia()
Dim order1 As String
order1 = ActiveCell.Offset(0, -1).Value
Month = Application.WorksheetFunction.VLookup(order1, Workbooks("Open Files.xlsm").Worksheets("Sheet1").Range("a2:b20").Value, 2, False)
Thanks
Arun
I am new to VBA programming, please help me to resolve the below question.
I have attached the excel file.
Form the attached excel, if I select the d1 cell, after run the below code it should give the result as "Feb16\", but I got an error
" Run-time error '1004': Unable to get the VLookup property of the Worksheetfuntion class ",
But if I select the "d2" cell, I got the result as "Apr16\".
I don't know why this error is coming.
The below is my code:
Sub OpenCatia()
Dim order1 As String
order1 = ActiveCell.Offset(0, -1).Value
Month = Application.WorksheetFunction.VLookup(order1, Workbooks("Open Files.xlsm").Worksheets("Sheet1").Range("a2:b20").Value, 2, False)
Thanks
Arun