Link to home
Start Free TrialLog in
Avatar of Seamus2626
Seamus2626Flag for Ireland

asked on

Vlookup error

Hi,

Im getting a syntax error on the below lookup i have created

Can anyone advise why this is so?

Thanks
Seamus





Function test()
Dim Res As Variant
Dim r As Long

r = ActiveCell

Res = Application.WorksheetFunction.VLookup(r,Phoenix Pivot!',A:A,1, 0)


End Function
Avatar of Runrigger
Runrigger
Flag of United Kingdom of Great Britain and Northern Ireland image

Phoenix Pivot!',A:A

should be

'Phoenix Pivot'!A:A
Avatar of Seamus2626

ASKER

Still getting a Syntax error

Seamus

Function test()
Dim Res As Variant
Dim r As Long

r = ActiveCell

Res = Application.WorksheetFunction.VLookup(r,'Phoenix Pivot'!A:A,1, 0)


End Function
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The bit A:A,1 will generate an error.  Normally you would have a cell reference, e.g:  A1:A10.
Thats the one,

Thanks
Seamus