Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Finds date but won't change cell

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Finds date but won't change cell

Hi Esau,

just modify the activecell line ...

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

HTH
Carim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Finds date but won't change cell

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

--
Charles Chickering

"A good example is twice the value of good advice."


"Esau" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Finds date but won't change cell

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

Jim Thomlinson


"Esau" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Finds date but won't change cell

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

Thanks again
--
Esau


"Charles Chickering" wrote:

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

--
Charles Chickering

"A good example is twice the value of good advice."


"Esau" wrote:

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

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
formula the finds value of cell above vpantus Excel Discussion (Misc queries) 2 November 9th 10 01:57 PM
Excel 2003 make 1 date cell automatically change another date cell Scotty Excel Worksheet Functions 4 April 22nd 10 09:01 AM
Need a formula that finds the last used cell in a range samfw Excel Worksheet Functions 4 February 6th 06 03:30 PM
I want tool which finds duplicate date in excel 2003 Sridhar Excel Worksheet Functions 3 March 23rd 05 10:19 AM
a macro which finds last cell in a column vikram Excel Programming 5 April 30th 04 06:10 PM


All times are GMT +1. The time now is 07:22 PM.

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"