View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Victor Delta Victor Delta is offline
external usenet poster
 
Posts: 33
Default Help needed with a macro

"Jim Cone" wrote in message
...
A different approach...
Sub IsItThere()
Dim FindString As Date
Dim rng As Range
Dim rCell As Range

FindString = Date
Set rng = Sheets("OtherSheet").Range("1:1").Cells

For Each rCell In rng
If Month(rCell.Value) = Month(FindString) Then
If Year(rCell.Value) = Year(FindString) Then
Application.Goto rCell, True
MsgBox rCell.Address
Exit Sub
End If
End If
Next
MsgBox "Nothing found"
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


Jim

Many thanks for your help.

However, I've pasted your macro into my sheet (changing 'other sheet' as
appropriate) but, when run it, I get a run-time error '13' - Type mismatch,
with the debugger highlighting this line:

If Month(rCell.Value) = Month(FindString) Then

Any ideas?

V