Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
checking in vba if item is found within a range
I have used the following code in the past but it no longer works in the
newer versions of Excel. Is there another way to check if an item is found or not within a range. Evern though it shows c equal to Nothing in watch mode, the code used below gives an error. Sub testFindDate() With Range("K4:K45") Set c = .Find("7/1/2006") End With If c.Value = "Nothing" Then MsgBox "not found" Else MsgBox c.Address End If -- djb |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
checking in vba if item is found within a range
Sub testFindDate()
Dim c As Excel.Range Set c = Range("K4:K45").Find("7/1/2006") If c Is Nothing Then MsgBox "not found" Else MsgBox c.Address End If End Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "djb" wrote in message I have used the following code in the past but it no longer works in the newer versions of Excel. Is there another way to check if an item is found or not within a range. Evern though it shows c equal to Nothing in watch mode, the code used below gives an error. Sub testFindDate() With Range("K4:K45") Set c = .Find("7/1/2006") End With If c.Value = "Nothing" Then MsgBox "not found" Else MsgBox c.Address End If -- djb |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I know on which worksheet an item is found? | Excel Discussion (Misc queries) | |||
Search Range for item in seperate range | Excel Programming | |||
Question about what the Find function returns if the item wasn't found | Excel Programming | |||
Range Name Found?? | Excel Programming | |||
Macro to jump from the find box to found item | Excel Programming |