Finding the current date

  • Thread starter Thread starter serge
  • Start date Start date
S

serge

Hi,

I'm using the following code to activate the current date in a column:

Private Sub workbook_activate()
Range("a:a").Cells.Find(what:=Date, LookIn:=xlFormulas, _
MatchCase:=False).Activate
End Sub

IF A1= 17/02/2004
A2= 18/02/2004
A3= 18/12/2004

Then it activates cell A2 which is good.
But if A1= 17/02/2004
A2= 18/12/2004
A3= 18/02/2004
then it activates cell A2.
What's wrong in this code?
 
Also, adding a sheet reference would be better, as you cannot be sure which
sheet will be active when you .Activate the workbook.

NickHK

Nick Cranham said:
serge,
If you add the "LookAt:=xlWhole", works.

NickHK
 
Back
Top