Finds date but won't change cell

G

Guest

Can some one tell me why it won't change cell H12
It finds the date

-- Range("F5").Select
Cells.Find(What:="3/1/2006", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False).Activate
If ActiveCell = 3 / 1 / 2006 Then
Range("H12").Value = 1
Esau
 
C

Carim

Hi Esau,

just modify the activecell line ...

If ActiveCell.Value = "3 /1/2006" Then

HTH
Carim
 
G

Guest

Because Excel thinks you mean 3 divided by 1 divided by 2006
Try this instead:
If ActiveCell = DateValue("3/1/2006") Then
 
G

Guest

"3/1/2006" is text, but 3/1/2006 is 3 divided by 1 divided by 2006. Probably
not what you intended...
 
G

Guest

Thanks Worked great I had just about gave up and was looking for some other way

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top