Just a simple question really.
I'm trying to use the vlookup function in vba. It works fine when I define the range directly within the code but I'm not sure how to replace the cell reference with a range name. The range name has been defined correctly but it is not recognised within the vlookup statement.
This is what I'm doing:
where "LoginData" is my named range.
Any help gratefully received.
Thanks
Harv
I'm trying to use the vlookup function in vba. It works fine when I define the range directly within the code but I'm not sure how to replace the cell reference with a range name. The range name has been defined correctly but it is not recognised within the vlookup statement.
This is what I'm doing:
Code:
If loginpin = _
Application.WorksheetFunction.VLookup(loginuser, "=LoginData", 2, False) Then
Sheets("ADMIN").Range("c9") = loginuser
Me.Hide
MsgBox "Log in successful"
Any help gratefully received.
Thanks
Harv