Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
serge,
If you add the "LookAt:=xlWhole", works. NickHK "serge " wrote in message ... 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? --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... serge, If you add the "LookAt:=xlWhole", works. NickHK "serge " wrote in message ... 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? --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding the current year | Excel Worksheet Functions | |||
finding 75 days before current date | Excel Worksheet Functions | |||
Finding values based on current month | Excel Worksheet Functions | |||
Finding current week and if any item has somthing due | Excel Worksheet Functions | |||
Can I automatically enter the current date or current time into a | New Users to Excel |