Using Current Date to Move to a Specific Sheet

TripleT

New Member
Joined
Jan 14, 2004
Messages
16
Hi

I would like to create a macro using Auto_Open. What I would like it to do is look at the current date, then move to a specific sheet. For example if today is the 15th of January, I'd like it to move to the January sheet; if it's the 15th of February, I'd like it to move to February's sheet.

Can someone help me out, or tell me where I can start.

Thanks.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Welcome to the Board!

Something like this might get you started:
Code:
Private Sub Workbook_Open()
    If Date >= #1/1/2004# And Date <= #1/31/2004# Then Application.Goto Reference:="January"
    If Date >= #2/1/2004# And Date <= #2/28/2004# Then Application.Goto Reference:="February"
    ' And so on...
End Sub
Hope that helps,

Smitty
 
Upvote 0
Thanks for your help. Both solutions worked perfect, and will be suitable for a variety of spreadsheets I'm working on.

Thanks again.
:biggrin:
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,390
Members
448,957
Latest member
Hat4Life

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