ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   timesheet (https://www.excelbanter.com/excel-programming/300624-timesheet.html)

dhaupert

timesheet
 
I was wondering if there was a was to automatically name a sheet as a
date in a given cell. I am working on a time sheet. I have a pulldown
with the date. I would like to set the date then automatically rename
the sheet tab to the date selected.

I tried to record a macro, but there seems to be a problem accessing
the sheet name tab.

I am not a programmer and am just struggling to get this to work. Any
help would be appreciated. ( ie additional sources etc.)


---
Message posted from http://www.ExcelForum.com/


Tom Ogilvy

timesheet
 
Right click on the sheet tab of the sheet and select View Code.

Paste in this code in the resulting module

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
On Error Resume Next
Me.Name = Target.Text
On Error GoTo 0
End If
End Sub

Adjust $A$1 to reflect the cell that contains the name. This should work in
Xl2000 and later.

--
Regards,
Tom Ogilvy


"dhaupert " wrote in message
...
I was wondering if there was a was to automatically name a sheet as a
date in a given cell. I am working on a time sheet. I have a pulldown
with the date. I would like to set the date then automatically rename
the sheet tab to the date selected.

I tried to record a macro, but there seems to be a problem accessing
the sheet name tab.

I am not a programmer and am just struggling to get this to work. Any
help would be appreciated. ( ie additional sources etc.)


---
Message posted from http://www.ExcelForum.com/





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

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