T
T De Villiers
I use the following type of function a lot:
if(iserror(vlookup(a,sheet2!$a$1:$d$15,2,0)),0,vlookup(a,sheet2!$a$1:$d$15,2,0))
I want to replace this with:
taz(a,sheet2!$a$1:$d$15,2)
the following is my current attempt which doesnt quite work,
many thanks for any help
Function taz(a, b, c)
taz = WorksheetFunction.VLookup(a, b, c, 0)
If WorksheetFunction.IsError(taz) Then
taz = 0
Else: taz
End If
End Function
if(iserror(vlookup(a,sheet2!$a$1:$d$15,2,0)),0,vlookup(a,sheet2!$a$1:$d$15,2,0))
I want to replace this with:
taz(a,sheet2!$a$1:$d$15,2)
the following is my current attempt which doesnt quite work,
many thanks for any help
Function taz(a, b, c)
taz = WorksheetFunction.VLookup(a, b, c, 0)
If WorksheetFunction.IsError(taz) Then
taz = 0
Else: taz
End If
End Function