I'm trying to use the Find() function in Visual Basic for an Excel macro, and I can't figure out how to detect whether the find was successful or not.
Set FoundCells = inventoryRange.Find(searchKey, LookIn:=xlValues, LookAt:=xlPart, MatchCase:=False)
9/27/2007 2:30:52 AM
If FoundCells Is Nothing Then ' empty results ' don't do shitElse ' do shitEnd IfThere is a big difference between "Null" and "Nothing"An Object type that has not been instanced is Nothing (i.e. FoundCells does not reference any object)]
9/27/2007 2:42:49 AM
LimpyNuts, FTW!I didn't realize that VB has a difference between = and "is". Thanks a lot man... that's been driving me crazy. I searched a ton of stuff online, and I guess I must have overlooked that distinction, since i'm not use to looking for it.
9/27/2007 12:28:49 PM
9/27/2007 12:43:25 PM