View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alan M Alan M is offline
external usenet poster
 
Posts: 69
Default Trouble with Find Method

I am using the following to find today's date in a column containing
dates for every day of the year.

I have defined the serxh target using the Dim ThisDate declaration but when
I run the code , for some unexpklained reason , I receive an error message
saying that the object is not defined.

Can you shed any light on this simple problem please?





Dim ThisDate As Range
Dim I As Range
Dim Current As Range

Sheets(2).Unprotect

Set ThisDate = Range("B3") 'Cell contains today's date

With ActiveSheet.Range("A:A")

' Searches for todays date in Column A

Cells.Find(What:=ThisDate, _
After:=Cells(796), LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 4).Select
Set Current = Selection