Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace #VALUE with 0
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace #VALUE with 0
Function evlookup(A, B, C)
On Error Resume Next d = WorksheetFunction.VLookup(A, B, C, False) On Error GoTo 0 If IsEmpty(d) Then evlookup = 0 Else evlookup = d End If End Function -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Lok Tak Cheong" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace #VALUE with 0
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Replace #VALUE with 0
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find and Replace - Replace with Blank Space | Excel Discussion (Misc queries) | |||
Can I replace a ' at the beginning of a text cell using Replace | Excel Discussion (Misc queries) | |||
How to Replace multiple words to replace using excell | Excel Programming | |||
find and replace - replace data in rows to separated by commas | Excel Worksheet Functions | |||
Using Find and Replace to replace " in a macro | Excel Programming |