Replace #VALUE with 0
Bienvenue !
--
Festina Lente
"Lok Tak Cheong" wrote:
Dear Bob & PapaDos:
Thanks a lot!
"PapaDos" wrote in message
...
Your call to VLookup generates an error and execution bumbs out of your
function.
Try this:
Function evlookup(A, B, C)
On Error Resume Next
evlookup = 0
evlookup = WorksheetFunction.VLookup(A, B, C, False)
On Error GoTo 0
End Function
--
Festina Lente
"Lok Tak Cheong" wrote:
I have set a formula as below, attempt to replace #VALUE for error with
0,
but it does not work, anyone can give me some hints?
Function evlookup(A, B, C)
D = WorksheetFunction.VLookup(A, B, C, False)
If WorksheetFunction.IsNA(D) = True Then
evlookup = 0
Else
evlookup = D
End If
End Function
|