Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
go to today's date
Hi and thanks for the help. I am using Excel 2003. I have a spread sheet that
holds the date for every day of the year. I would like to create a macro that takes me to the current date on the sheet every time I open the workbook. I know that in Access that macro is named AutoExec and in Word it is called AutoOpen but I don't know what to call it in Excel to automatically run the macro when the workbook is opened. I don't have any idea how to make the macro find the current date. If you put code in here please go easy on me. I don't ever do any code. My worksheet name is 2006. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
go to today's date
I'm guessing that the worksheet name is Sheet1 and the dates are in column A.
Option Explicit Sub Auto_Open() Dim Res As Variant Dim Wks As Worksheet Set Wks = Worksheets("sheet1") With Wks Res = Application.Match(CLng(Date), .Range("a:a"), 0) If IsError(Res) Then MsgBox "Date not found" Else Application.Goto Wks.Range("a:a")(Res), scroll:=True End If End With End Sub If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm SheriTingle wrote: Hi and thanks for the help. I am using Excel 2003. I have a spread sheet that holds the date for every day of the year. I would like to create a macro that takes me to the current date on the sheet every time I open the workbook. I know that in Access that macro is named AutoExec and in Word it is called AutoOpen but I don't know what to call it in Excel to automatically run the macro when the workbook is opened. I don't have any idea how to make the macro find the current date. If you put code in here please go easy on me. I don't ever do any code. My worksheet name is 2006. Thanks. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
conditional formatting for cell date to equal today's date | Excel Worksheet Functions | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
How to use Today's date in a cell and make it stay the same date | Excel Discussion (Misc queries) | |||
I need today's date returned as date format in formula | Excel Discussion (Misc queries) | |||
Count number of cells with date <today's date | New Users to Excel |