Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Can I replace a ' at the beginning of a text cell using Replace Hilde Excel Discussion (Misc queries) 4 September 10th 07 06:22 PM
How to Replace multiple words to replace using excell ramsun Excel Programming 1 August 10th 06 01:52 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
Using Find and Replace to replace " in a macro snail30152 Excel Programming 1 April 13th 06 11:58 PM


All times are GMT +1. The time now is 08:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"