|
-
Mar 26th, 2007, 03:29 AM
#1
Thread Starter
New Member
Macro - Jump To Today On Worksheet
im trying find a simple macro or vba code that when ran it will jump to todays date on the excel worksheet. something basic w/
Code:
Sub Today_Find()
<find todays date!>
End Sub
i need to be able to search within formulas, as all the dates in all the workbooks are set up like this, the the layout is not in a single column:
Each cell
1/1/07
=above cell+1
=above cell+1
=above cell+1
=above cell+1
=above cell+1
=above cell+1...
I tryied this
Code:
Sub FindDate()
Dim c As Range
Set c = ActiveSheet.Cells.Find(what:=Date, LookIn:=xlValues)
If Not c Is Nothing Then c.Select
End Sub
but it only is picking up a typed in date. for example if today was 1/1/07 and the macro was ran it would find it, but for all the other days they contain a formula which is not being found when macro is run.
-
Mar 26th, 2007, 09:17 AM
#2
Addicted Member
Re: Macro - Jump To Today On Worksheet
just recorded this an it works
Cells.Find(What:=Date, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
-
Mar 26th, 2007, 09:19 AM
#3
Addicted Member
Re: Macro - Jump To Today On Worksheet
its to do with the formatting of the cells too!
Cells.Find(What:=Format(Date, "d/m/yy"), After:=ActiveCell, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|