Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
In my Sheet1 cell C5 - I have 8/01/2006 (actually 38930)
in cells C6 I have =C5+1 - Copied down to C29 So that C26 = 8/22/2006 -- Today! Using the code - My Rng "IS NOTHING" ' when I step through the code Why? Sub Find_Todays_Date() Dim FindString As Date Dim rng As Range FindString = Date With Sheets("Sheet1").Range("C5:C29") Set rng = .Find(What:=FindString, _ After:=.Cells(.Cells.Count), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not rng Is Nothing Then Application.Goto rng, True Else MsgBox "Nothing found" End If End With End Sub |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
LookIn:=xlValues
-- Jim "Jim May" wrote in message ... | In my Sheet1 cell C5 - I have 8/01/2006 (actually 38930) | in cells C6 I have =C5+1 - Copied down to C29 | So that C26 = 8/22/2006 -- Today! | | Using the code - My Rng "IS NOTHING" ' when I step through the code | | Why? | | Sub Find_Todays_Date() | Dim FindString As Date | Dim rng As Range | FindString = Date | With Sheets("Sheet1").Range("C5:C29") | Set rng = .Find(What:=FindString, _ | After:=.Cells(.Cells.Count), _ | LookIn:=xlFormulas, _ | LookAt:=xlWhole, _ | SearchOrder:=xlByRows, _ | SearchDirection:=xlNext, _ | MatchCase:=False) | If Not rng Is Nothing Then | Application.Goto rng, True | Else | MsgBox "Nothing found" | End If | End With | End Sub |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Jim;
I missed (seeing) the xlFormulas.. daaaaaa.... Tks again. Jim May "Jim Rech" wrote: LookIn:=xlValues -- Jim "Jim May" wrote in message ... | In my Sheet1 cell C5 - I have 8/01/2006 (actually 38930) | in cells C6 I have =C5+1 - Copied down to C29 | So that C26 = 8/22/2006 -- Today! | | Using the code - My Rng "IS NOTHING" ' when I step through the code | | Why? | | Sub Find_Todays_Date() | Dim FindString As Date | Dim rng As Range | FindString = Date | With Sheets("Sheet1").Range("C5:C29") | Set rng = .Find(What:=FindString, _ | After:=.Cells(.Cells.Count), _ | LookIn:=xlFormulas, _ | LookAt:=xlWhole, _ | SearchOrder:=xlByRows, _ | SearchDirection:=xlNext, _ | MatchCase:=False) | If Not rng Is Nothing Then | Application.Goto rng, True | Else | MsgBox "Nothing found" | End If | End With | End Sub |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub gotodate()
On Error GoTo qi Application.Goto Range(Columns(1).Find(Date).Address) qi: End Sub -- Don Guillett SalesAid Software "Jim May" wrote in message ... In my Sheet1 cell C5 - I have 8/01/2006 (actually 38930) in cells C6 I have =C5+1 - Copied down to C29 So that C26 = 8/22/2006 -- Today! Using the code - My Rng "IS NOTHING" ' when I step through the code Why? Sub Find_Todays_Date() Dim FindString As Date Dim rng As Range FindString = Date With Sheets("Sheet1").Range("C5:C29") Set rng = .Find(What:=FindString, _ After:=.Cells(.Cells.Count), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not rng Is Nothing Then Application.Goto rng, True Else MsgBox "Nothing found" End If End With End Sub |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
thanks Don;
Good substitute for what I had Jim "Don Guillett" wrote: Sub gotodate() On Error GoTo qi Application.Goto Range(Columns(1).Find(Date).Address) qi: End Sub -- Don Guillett SalesAid Software "Jim May" wrote in message ... In my Sheet1 cell C5 - I have 8/01/2006 (actually 38930) in cells C6 I have =C5+1 - Copied down to C29 So that C26 = 8/22/2006 -- Today! Using the code - My Rng "IS NOTHING" ' when I step through the code Why? Sub Find_Todays_Date() Dim FindString As Date Dim rng As Range FindString = Date With Sheets("Sheet1").Range("C5:C29") Set rng = .Find(What:=FindString, _ After:=.Cells(.Cells.Count), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not rng Is Nothing Then Application.Goto rng, True Else MsgBox "Nothing found" End If End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to return a value between date ranges | Excel Worksheet Functions | |||
Most Current Date | Excel Worksheet Functions | |||
enter a current date in a cell? | Excel Discussion (Misc queries) | |||
Calculating days between current date and a date in future NETWORKDAYS() function | Excel Worksheet Functions | |||
Calculating current age from 2 date cells | Excel Worksheet Functions |