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 thi...
Nov 02, 2017
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