Forum Discussion
swelch
Oct 24, 2017Copper Contributor
Automatically change tab name
Is there a way to change the date name on a worksheet tab. I have to set up a worksheet with tabs for Tues Wed Thurs for the whole year. I have to have the date for each tab, is there anyway to this automatically? It is time consuming to enter each date manually.
You may want to try the following code.
-------------------------
Sub Tues_Wed_Thurs()
Start = InputBox("Enter the start date: ")
Application.ScreenUpdating = 0
For DT = CDate(Start) To CDate(Start) + 365
If Application.Weekday(DT) > 2 And Application.Weekday(DT) < 6 Then
Sheets.Add After:=ActiveSheet
ActiveSheet.Name = Format(DT, "dd_mm_yyyy")
End If
Next
Application.ScreenUpdating = 1
End Sub--------------------------
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” Excel MVP – Excel (2009-2018)
ISRAEL- Haytham AmairahSilver ContributorHi,
You can do that, but you need some lines of code.
I'll try to help you, but please provide me with the date sequence you want to label tabs.