Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Question about what the Find function returns if the item wasn't found
Hi Guys,
This is my first post. I've been reading the forums for a whil though. I find them helpful from time to time. I'm trying to teac myself how to code VBA for Excel. Anyway, I have a question I'm hoping someone can answer for me. Basically, what I'm trying to do is search a column for a value an return the row number where the value is stored. But if the value wa not found I want to throw up a msgbox saying that the value wasn' found. Here is a code sample: iRow = Columns("A").Find(sName).Row if (condition where the value was not found) then msxbox ("Name: '" & sName "' was not found.") end if What I need to know is the condition that will make the if statemen true. I've tried using things like IsNull(iRow) but that did not work Does the find function return a special value if it is unsuccessfu and if so, what is it? If not, any suggestions on how to handle this? I've been looking everywhere for the answer to this but it seems lik simple stuff like this is the hardest stuff to find. Thanks -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
To find rate of each item from item.xls and to copy price.xls | Excel Discussion (Misc queries) | |||
FIND function does not return ZERO when text is not found | Excel Worksheet Functions | |||
Find function returns the #VALUE! error value | Excel Discussion (Misc queries) | |||
How do I know on which worksheet an item is found? | Excel Discussion (Misc queries) | |||
Macro to jump from the find box to found item | Excel Programming |