Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DJB DJB is offline
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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
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
How do I know on which worksheet an item is found? Talar Excel Discussion (Misc queries) 2 June 21st 06 11:56 AM
Search Range for item in seperate range [email protected][_2_] Excel Programming 6 January 9th 06 03:53 PM
Question about what the Find function returns if the item wasn't found JC10001 Excel Programming 4 April 6th 04 02:44 AM
Range Name Found?? Michael Kintner Excel Programming 2 January 6th 04 06:25 PM
Macro to jump from the find box to found item Todd[_9_] Excel Programming 14 October 17th 03 08:04 PM


All times are GMT +1. The time now is 04:50 AM.

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

About Us

"It's about Microsoft Excel"