View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mike Rediger Mike Rediger is offline
external usenet poster
 
Posts: 3
Default Function Add-in troubleshooting-Vlookup

Perfect!

Thanks for your help!

"Colo" wrote in message
...
Hi Mike,

Mike Rediger wrote:
*
The code works for non-errors, however, returns #VALUE! instead of ""
if the
formula cannot be resolved.

Help! *


Works for non errors? Do you have a line "On Error Resume Next"
somewhere?

Anyway, "Application.WorksheetFunction.VLookup" need error trap to work
for non errors like this.

Please try this code.


Code:
--------------------

Function vlook(cell, range, column)
On Error Resume Next
vlook = Application.WorksheetFunction.VLookup(cell, range, column,

False)
If Err.Number < 0 Then vlook = ""
End Function

--------------------



---
Message posted from http://www.ExcelForum.com/