![]() |
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 |
All times are GMT +1. The time now is 03:51 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com