MrExcel Publishing
Your One Stop for Excel Tips & Solutions

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?

Posted by Tom Morales on August 30, 2001 11:39 AM

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