Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Another way is to use only application as the qualifier
Dim res as Variant res = Application.Vlookup() if iserror(res) then msgbox "Not found" Else msgbox "Value returned is " & res End if If you use worksheetfunction as the qualifier, then it returns a trappable error (1004 type error). -- Regards, Tom Ogilvy "Frank Kabel" wrote in message ... Hi Julie this happens if the item is not found. One way arround it: on error resume next kapplication.worksheetfunction.vlookup(...) if err.number<0 then k="Error" end if on error goto 0 msgbox k -----Original Message----- Hi for the first time i'm using worksheet functions in vba and was surprised to find that k = application.worksheetfunction.vlookup(pipes(j),Sh eets ("Database").Range("Pip e_Number"),2,0) shows k as empty rather than "erroring" or #NA .. i tried to get a handle on this in vba help but it didn't seem to explain this behaviour - can anyone explain to me why and, in some ways, more importantly how i can get "k" to "error" if the item isn't found? Thanks JulieD . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reuse Application.WorksheetFunction | Excel Discussion (Misc queries) | |||
Need help with Application.WorksheetFunction | Excel Discussion (Misc queries) | |||
Application.WorksheetFunction.Upper | Excel Programming | |||
application.worksheetfunction.mmult help | Excel Programming | |||
Using Application.WorksheetFunction.Ln(...) in VBA | Excel Programming |