Vba [Solved/Closed]

Report
Posts
2
Registration date
Thursday July 30, 2015
Status
Member
Last seen
July 30, 2015
-
Posts
2
Registration date
Thursday July 30, 2015
Status
Member
Last seen
July 30, 2015
-
I want to append the month name at the end of the tab names in my workbook
I have 86 tabs which are named by employee name and every month I want to run a VBA code that appends the month name
So for instance "Joe Bloggs-July"

1 reply

Posts
2670
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
October 22, 2020
446
Hi Looneybin,

The code below will add the month to the sheet name. On row 5 you will find on example of excluding a sheet. You can add to this row to exclude more sheets or you can remove the row (as well as row 7) if you don't want to exclude any sheet.

Sub RunMe()
Dim ws As Worksheet

For Each ws In Worksheets
    If ws.Name <> "Master" Then
        ws.Name = ws.Name & "-" & Format(Date, "Mmmm")
    End If
Next ws
End Sub


Best regards,
Trowa
Posts
2
Registration date
Thursday July 30, 2015
Status
Member
Last seen
July 30, 2015

thank you so much that works a treat