Archive of Mr Excel Message Board

Back to Dates in Excel archive index
Back to archive home

autmatic date fill-in
Posted by Tove on August 30, 2001 11:23 AM
I would like to have the date of entry entered automatically in a particular cell, and then for that spreadsheet's tab to be labeled "cash [today's date]". Is this possible?

Re: autmatic date fill-in
Posted by Tom Morales on August 30, 2001 11:39 AM
Tove
Right-click the worksheet tab, and select "View Code". Then insert the following code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
thedate = Int(Now)
'here, Cell A1 has been chosen for your date register
[A1].Value = thedate
tabdate = Format(thedate, "mm-dd-yy")
thename = "cash " & tabdate
ActiveSheet.Name = thename
End Sub
Good Luck
Tom

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.