Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default Selecting Current date

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default Selecting Current date

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default Selecting Current date

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



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
How to return a value between date ranges Mary-Lou Excel Worksheet Functions 7 May 26th 06 10:00 PM
Most Current Date Mark Jackson Excel Worksheet Functions 4 May 12th 06 04:18 PM
enter a current date in a cell? Tpeyton77 Excel Discussion (Misc queries) 2 June 8th 05 02:30 AM
Calculating days between current date and a date in future NETWORKDAYS() function Faheem Khan Excel Worksheet Functions 2 February 10th 05 07:18 PM
Calculating current age from 2 date cells dhealy Excel Worksheet Functions 1 January 19th 05 04:50 PM


All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"