LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Error.Type or IsError to trap #VALUE! and #NUM!

I am using the DGET worksheet function to lookup values and I want to display
text explaining the #VALUE! and #NUM! responses as "Item not found" and
"Numerous Items Found".

If I trap it with IsError it will return one value for all of them, and so I
wanted to use Error.Type that I found in a 2002 manual. I'm using 2003 and I
can't find this function anywhere in my object browser or help screen. Does
it exist? How can I differentiate between these two?

Heres my code if it helps:
'Note= Sheeti, InventoryRange, CriteriaRange, and y are all defined variables

Sheeti.Cells(y, 2).Value = Application.DGet(InventoryRange, 3,
CriteriaRange)

If Error.Type(Sheeti.Cells(y, 2)) = 3 Then
Sheeti.Cells(y, 2).Value = "Not in Stock"
ElseIf Error.Type(Sheeti.Cells(y, 2)) = 6 Then
Sheeti.Cells(y, 2).Value = "Numerous"
End If


 
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
Cleaner Error trap in Loop. plys Excel Discussion (Misc queries) 3 January 20th 07 03:31 AM
What does ISERROR look at besides the 7 Error Types? Bob Excel Worksheet Functions 5 November 17th 06 06:27 PM
Best way to trap error to MsgBox "Too many cell formats" [email protected] Excel Discussion (Misc queries) 0 August 22nd 06 09:52 PM
How do I use ISERROR in functions to hide error values Daz Excel Worksheet Functions 4 June 6th 06 07:30 AM
Type Mismatch Error David Excel Discussion (Misc queries) 2 December 11th 05 04:46 PM


All times are GMT +1. The time now is 06:24 PM.

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

About Us

"It's about Microsoft Excel"