ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to automatically goto to today's date (https://www.excelbanter.com/excel-worksheet-functions/125857-how-automatically-goto-todays-date.html)

Hans gmail

How to automatically goto to today's date
 
I have a worksheet where I type in lists of names on a daily basis. I have
formatted the worksheet with the column headings and row numbers plus the
calendar dates for the whole month (one worksheet for one month). How can i
make the cursor go to a specified date like "today's date" when I open the
worksheet (instead of scrolling down to today's date)? Is it thru a function
or macro? I highly appreciate any help anyone can offer.

Bob Phillips

How to automatically goto to today's date
 
This code will select the worksheet assuming the format is Jan , Feb, Mar,
etc., and then selects the row corresponding to the day + 1 (to allow for
headings) and column B

Private Sub Workbook_Open()
With ThisWorkbook
.Worksheets(Format(Date, "mmm")).Activate
.Range("B" & Day(Date) + 1).Select
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hans gmail" <Hans wrote in message
...
I have a worksheet where I type in lists of names on a daily basis. I

have
formatted the worksheet with the column headings and row numbers plus the
calendar dates for the whole month (one worksheet for one month). How can

i
make the cursor go to a specified date like "today's date" when I open the
worksheet (instead of scrolling down to today's date)? Is it thru a

function
or macro? I highly appreciate any help anyone can offer.




Hans gmail

How to automatically goto to today's date
 
Dear Bob,

I tried your code as instructed but when I tried to re-open the workbook, an
error message comes out - "Compile Error: Method or Data member not found"
and the Private Sub Workbook_Open words are highlighted yellow while the
..Range protion is highlighted in blue.

I have constructed my worksheet in such a way that I made a "Calendar" on
the side with cell G13 having the date Jan 01, 2007 and cell H13 as
Workday(G13,1); I13 as Workday(H13,1) up to K13. And G14 as Workday(K13,1) up
to K14. Then same set of formula for G15 up to K15 and G16 to K16. I then
placed in cell C41 the formula +H13 to signify the date for that day's list
of names that I need to input.

Hope things are clearer.


"Bob Phillips" wrote:

This code will select the worksheet assuming the format is Jan , Feb, Mar,
etc., and then selects the row corresponding to the day + 1 (to allow for
headings) and column B

Private Sub Workbook_Open()
With ThisWorkbook
.Worksheets(Format(Date, "mmm")).Activate
.Range("B" & Day(Date) + 1).Select
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hans gmail" <Hans wrote in message
...
I have a worksheet where I type in lists of names on a daily basis. I

have
formatted the worksheet with the column headings and row numbers plus the
calendar dates for the whole month (one worksheet for one month). How can

i
make the cursor go to a specified date like "today's date" when I open the
worksheet (instead of scrolling down to today's date)? Is it thru a

function
or macro? I highly appreciate any help anyone can offer.





Bob Phillips

How to automatically goto to today's date
 
Sorry, I errored, it should be

Private Sub Workbook_Open()
With ThisWorkbook.Worksheets(Format(Date, "mmm"))
.Activate
.Range("B" & Day(Date) + 1).Select
End With
End Sub



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hans gmail" wrote in message
...
Dear Bob,

I tried your code as instructed but when I tried to re-open the workbook,

an
error message comes out - "Compile Error: Method or Data member not found"
and the Private Sub Workbook_Open words are highlighted yellow while the
.Range protion is highlighted in blue.

I have constructed my worksheet in such a way that I made a "Calendar" on
the side with cell G13 having the date Jan 01, 2007 and cell H13 as
Workday(G13,1); I13 as Workday(H13,1) up to K13. And G14 as Workday(K13,1)

up
to K14. Then same set of formula for G15 up to K15 and G16 to K16. I then
placed in cell C41 the formula +H13 to signify the date for that day's

list
of names that I need to input.

Hope things are clearer.


"Bob Phillips" wrote:

This code will select the worksheet assuming the format is Jan , Feb,

Mar,
etc., and then selects the row corresponding to the day + 1 (to allow

for
headings) and column B

Private Sub Workbook_Open()
With ThisWorkbook
.Worksheets(Format(Date, "mmm")).Activate
.Range("B" & Day(Date) + 1).Select
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hans gmail" <Hans wrote in message
...
I have a worksheet where I type in lists of names on a daily basis. I

have
formatted the worksheet with the column headings and row numbers plus

the
calendar dates for the whole month (one worksheet for one month). How

can
i
make the cursor go to a specified date like "today's date" when I open

the
worksheet (instead of scrolling down to today's date)? Is it thru a

function
or macro? I highly appreciate any help anyone can offer.







Hans gmail

How to automatically goto to today's date
 
Dear Bob,
The new module works, it goes to the row number + 1 of today's date. But
what i need is different. I have typed in (actually used a formula) all the
dates of the month at roughly every 15 rows. When I open the workbook, I have
to scroll down to the area of today's date. What I wanted is if upon opening,
the cursor will go to "today's date" whereever it is several rows down.

Thanks in advance.

"Bob Phillips" wrote:

Sorry, I errored, it should be

Private Sub Workbook_Open()
With ThisWorkbook.Worksheets(Format(Date, "mmm"))
.Activate
.Range("B" & Day(Date) + 1).Select
End With
End Sub



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hans gmail" wrote in message
...
Dear Bob,

I tried your code as instructed but when I tried to re-open the workbook,

an
error message comes out - "Compile Error: Method or Data member not found"
and the Private Sub Workbook_Open words are highlighted yellow while the
.Range protion is highlighted in blue.

I have constructed my worksheet in such a way that I made a "Calendar" on
the side with cell G13 having the date Jan 01, 2007 and cell H13 as
Workday(G13,1); I13 as Workday(H13,1) up to K13. And G14 as Workday(K13,1)

up
to K14. Then same set of formula for G15 up to K15 and G16 to K16. I then
placed in cell C41 the formula +H13 to signify the date for that day's

list
of names that I need to input.

Hope things are clearer.


"Bob Phillips" wrote:

This code will select the worksheet assuming the format is Jan , Feb,

Mar,
etc., and then selects the row corresponding to the day + 1 (to allow

for
headings) and column B

Private Sub Workbook_Open()
With ThisWorkbook
.Worksheets(Format(Date, "mmm")).Activate
.Range("B" & Day(Date) + 1).Select
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Hans gmail" <Hans wrote in message
...
I have a worksheet where I type in lists of names on a daily basis. I
have
formatted the worksheet with the column headings and row numbers plus

the
calendar dates for the whole month (one worksheet for one month). How

can
i
make the cursor go to a specified date like "today's date" when I open

the
worksheet (instead of scrolling down to today's date)? Is it thru a
function
or macro? I highly appreciate any help anyone can offer.








All times are GMT +1. The time now is 04:59 AM.

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