![]() |
Vlookup error
I'm using very simple Vlookup function that is working very well in a
spreadsheet but in VB it says unable to get Vlookup property in WorksheetFunction class. Set rngLogIn = Worksheets("Main").Range("A9") varName = Application.WorksheetFunction.VLookup(rngLogIn, LoginName, 3, False) Can anybody help? Thanks |
Vlookup error
Thanks, I've already fixed it.
"Alex" wrote: I'm using very simple Vlookup function that is working very well in a spreadsheet but in VB it says unable to get Vlookup property in WorksheetFunction class. Set rngLogIn = Worksheets("Main").Range("A9") varName = Application.WorksheetFunction.VLookup(rngLogIn, LoginName, 3, False) Can anybody help? Thanks |
Vlookup error
I'd assume that you changed rngLogIn to rngLogIn.Value in the function call?
alternative dim login as string LogIn = Worksheets("Main").Range("A9").Value varName = Application.WorksheetFunction.VLookup(LogIn, LoginName, 3, False) note that if there's no match then VLookup raises an error which you'll need to handle too. "Alex" wrote: Thanks, I've already fixed it. "Alex" wrote: I'm using very simple Vlookup function that is working very well in a spreadsheet but in VB it says unable to get Vlookup property in WorksheetFunction class. Set rngLogIn = Worksheets("Main").Range("A9") varName = Application.WorksheetFunction.VLookup(rngLogIn, LoginName, 3, False) Can anybody help? Thanks |
All times are GMT +1. The time now is 11:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com