ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   set up macro to goto cell with "today" in (https://www.excelbanter.com/excel-worksheet-functions/179905-set-up-macro-goto-cell-today.html)

Stuart WJG

set up macro to goto cell with "today" in
 
I have mutiple worksheets with daily information covering 6 months. I have
set up formula that highlights column with "today" realting to current date.
I would like to set up macro on each worksheet that I can run to take me to
"todays" date

Bernie Deitrick

set up macro to goto cell with "today" in
 
Stuart,

For Each Wks In Activeworkbook.Worksheets
Wks.Select
Wks.Range("B:B").Find(Format(Now(), "mm/dd/yy"), , xlValues).Select
Next Wks

Change the mm/dd/yy to reflect the formatting that you use for your dates.

HTH,
Bernie
MS Excel MVP


"Stuart WJG" <Stuart wrote in message
...
I have mutiple worksheets with daily information covering 6 months. I have
set up formula that highlights column with "today" realting to current date.
I would like to set up macro on each worksheet that I can run to take me to
"todays" date




Stuart WJG[_2_]

set up macro to goto cell with "today" in
 
Bernie
Not sure what you mean by Wks
This is is what I have

A1 A2 A3 TODAY A5 A6
10-Mar-08 11-Mar-08 12-Mar-08 13-Mar-08 14-Mar-08 15-Mar-08

I would like macro to goto A4 in this case or A5 if tomorrow

Thanks for you help
Stuart

"Bernie Deitrick" wrote:

Stuart,

For Each Wks In Activeworkbook.Worksheets
Wks.Select
Wks.Range("B:B").Find(Format(Now(), "mm/dd/yy"), , xlValues).Select
Next Wks

Change the mm/dd/yy to reflect the formatting that you use for your dates.

HTH,
Bernie
MS Excel MVP


"Stuart WJG" <Stuart wrote in message
...
I have mutiple worksheets with daily information covering 6 months. I have
set up formula that highlights column with "today" realting to current date.
I would like to set up macro on each worksheet that I can run to take me to
"todays" date





Fred Smith[_4_]

set up macro to goto cell with "today" in
 
That's exactly what Bernie's macro does. Did you try it?

Regards,
Fred.

"Stuart WJG" wrote in message
...
Bernie
Not sure what you mean by Wks
This is is what I have

A1 A2 A3 TODAY A5 A6
10-Mar-08 11-Mar-08 12-Mar-08 13-Mar-08 14-Mar-08 15-Mar-08

I would like macro to goto A4 in this case or A5 if tomorrow

Thanks for you help
Stuart

"Bernie Deitrick" wrote:

Stuart,

For Each Wks In Activeworkbook.Worksheets
Wks.Select
Wks.Range("B:B").Find(Format(Now(), "mm/dd/yy"), , xlValues).Select
Next Wks

Change the mm/dd/yy to reflect the formatting that you use for your
dates.

HTH,
Bernie
MS Excel MVP


"Stuart WJG" <Stuart wrote in message
...
I have mutiple worksheets with daily information covering 6 months. I
have
set up formula that highlights column with "today" realting to current
date.
I would like to set up macro on each worksheet that I can run to take
me to
"todays" date






Bernie Deitrick

set up macro to goto cell with "today" in
 
Stuart,

Try this:

Sub GoToToday()
Range("A:A").Find(Format(Now(), "dd-mmm-yy"), , xlValues).Select
End Sub

This will find today's date on the currently active worksheet.

HTH,
Bernie
MS Excel MVP


"Stuart WJG" wrote in message
...
Bernie
Not sure what you mean by Wks
This is is what I have

A1 A2 A3 TODAY A5 A6
10-Mar-08 11-Mar-08 12-Mar-08 13-Mar-08 14-Mar-08 15-Mar-08

I would like macro to goto A4 in this case or A5 if tomorrow

Thanks for you help
Stuart

"Bernie Deitrick" wrote:

Stuart,

For Each Wks In Activeworkbook.Worksheets
Wks.Select
Wks.Range("B:B").Find(Format(Now(), "mm/dd/yy"), , xlValues).Select
Next Wks

Change the mm/dd/yy to reflect the formatting that you use for your dates.

HTH,
Bernie
MS Excel MVP


"Stuart WJG" <Stuart wrote in message
...
I have mutiple worksheets with daily information covering 6 months. I have
set up formula that highlights column with "today" realting to current date.
I would like to set up macro on each worksheet that I can run to take me to
"todays" date







Lori

set up macro to goto cell with "today" in
 
Another way is to insert a Name (Edit Menu) e.g. "T" which refers to:
=INDEX(!$A:$A,MATCH(TODAY(),!$A:$A,0))
Then just type "t" into the Name Box (to the left of the formula bar)

....OR you can choose Record New Macro (tools Menu) and type in the Name Box:
index(a:a,match(today(),a:a,0))
stop recording and assign this to a button


"Stuart WJG" wrote:

I have mutiple worksheets with daily information covering 6 months. I have
set up formula that highlights column with "today" realting to current date.
I would like to set up macro on each worksheet that I can run to take me to
"todays" date


Stuart WJG[_2_]

set up macro to goto cell with "today" in
 
Hi
This is the macro I have done
Sub GoToToday()
Range("F2:HP2").Find(Format(Now(), "dd-mm-yy"), , xlValues).Select
End Sub
When I run i get this error
Run Time error: "91"
Object variable or With block variable not set
I am running Excel 2007

"Bernie Deitrick" wrote:

Stuart,

Try this:

Sub GoToToday()
Range("A:A").Find(Format(Now(), "dd-mmm-yy"), , xlValues).Select
End Sub

This will find today's date on the currently active worksheet.

HTH,
Bernie
MS Excel MVP


"Stuart WJG" wrote in message
...
Bernie
Not sure what you mean by Wks
This is is what I have

A1 A2 A3 TODAY A5 A6
10-Mar-08 11-Mar-08 12-Mar-08 13-Mar-08 14-Mar-08 15-Mar-08

I would like macro to goto A4 in this case or A5 if tomorrow

Thanks for you help
Stuart

"Bernie Deitrick" wrote:

Stuart,

For Each Wks In Activeworkbook.Worksheets
Wks.Select
Wks.Range("B:B").Find(Format(Now(), "mm/dd/yy"), , xlValues).Select
Next Wks

Change the mm/dd/yy to reflect the formatting that you use for your dates.

HTH,
Bernie
MS Excel MVP


"Stuart WJG" <Stuart wrote in message
...
I have mutiple worksheets with daily information covering 6 months. I have
set up formula that highlights column with "today" realting to current date.
I would like to set up macro on each worksheet that I can run to take me to
"todays" date







Bernie Deitrick

set up macro to goto cell with "today" in
 
Stuart,

Your origianl post shows a format of dd-mmm-yy

To be certain, try this:

Sub TryNow()
Range("F2:HP2").NumberFormat = "dd-mmm-yy"
On Error GoTo NoDate
Range("F2:HP2").Find(Format(Now(), "dd-mmm-yy"), , xlValues).Select
Exit Sub
NoDate:
MsgBox Format(Now(), "dd-mmm-yy") & " was not found."
End Sub

Note that this will also fail if the columns are not wide enough to show the date - if they have
######## in them, increase the column width.

HTH,
Bernie
MS Excel MVP


"Stuart WJG" wrote in message
...
Hi
This is the macro I have done
Sub GoToToday()
Range("F2:HP2").Find(Format(Now(), "dd-mm-yy"), , xlValues).Select
End Sub
When I run i get this error
Run Time error: "91"
Object variable or With block variable not set
I am running Excel 2007

"Bernie Deitrick" wrote:

Stuart,

Try this:

Sub GoToToday()
Range("A:A").Find(Format(Now(), "dd-mmm-yy"), , xlValues).Select
End Sub

This will find today's date on the currently active worksheet.

HTH,
Bernie
MS Excel MVP


"Stuart WJG" wrote in message
...
Bernie
Not sure what you mean by Wks
This is is what I have

A1 A2 A3 TODAY A5 A6
10-Mar-08 11-Mar-08 12-Mar-08 13-Mar-08 14-Mar-08 15-Mar-08

I would like macro to goto A4 in this case or A5 if tomorrow

Thanks for you help
Stuart

"Bernie Deitrick" wrote:

Stuart,

For Each Wks In Activeworkbook.Worksheets
Wks.Select
Wks.Range("B:B").Find(Format(Now(), "mm/dd/yy"), , xlValues).Select
Next Wks

Change the mm/dd/yy to reflect the formatting that you use for your dates.

HTH,
Bernie
MS Excel MVP


"Stuart WJG" <Stuart wrote in message
...
I have mutiple worksheets with daily information covering 6 months. I have
set up formula that highlights column with "today" realting to current date.
I would like to set up macro on each worksheet that I can run to take me to
"todays" date










All times are GMT +1. The time now is 09:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com