Select todays cell

Mike454

New Member
Joined
Feb 23, 2002
Messages
5
My column A is a list of dates for the whole year, i need to write a macro that will automatically move the cursor to the current date, any ideas please.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
This one, though recorded will work. In Sheet2!A1, I wrote =Today()

This macro goes to Sheet2!A1, copies the date, then finds it in column A of Sheet1.

Sub Macro3()
Application.ScreenUpdate = False
Sheets("Sheet2").Select
Selection.Copy
Sheets("Sheet1").Select
Cells.Find(What:="02/24/2002", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False).Activate
Application.ScreenUpdating = True
End Sub


I recorded it then added screen updating. Might be an easier way.
 
Upvote 0
Hi
If your date is a value (ie not =today() or now()) then you can use this
Cells.Find(What:=Date, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False).Activate
End Sub

Derek
This message was edited by Derek on 2002-02-24 17:25
This message was edited by Derek on 2002-02-24 17:29
 
Upvote 0
You could try this as well.

Sub GoToNow()
Range("A1").Select
While ActiveCell.Value <> Int(Now)
ActiveCell.Offset(1, 0).Select
Wend
End Sub

Jay
 
Upvote 0
Autolycus
That a neat bit of code. Is there any way you can select today's date regardless of whether it is a value or the result of a formula, eg =today(). I can only seem to do one or the other but not both.
regards
Derek
 
Upvote 0
On 2002-02-24 20:23, Derek wrote:
Autolycus
That a neat bit of code. Is there any way you can select today's date regardless of whether it is a value or the result of a formula, eg =today(). I can only seem to do one or the other but not both.
regards
Derek


Columns(1).Find(What:=Format(Date, "d-mmm-yy"), After:=[A65536]).Select

Or whatever date format in in column 1.
 
Upvote 0
Correction. Should read :-

Columns(1).Find(What:=Format(Date, "d-mmm-yy"), After:=[A65536], LookIn:=xlValues).Select
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,184
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top