Vba

Solved/Closed
looneybin Posts 2 Registration date Thursday July 30, 2015 Status Member Last seen July 30, 2015 - Jul 30, 2015 at 12:39 AM
looneybin Posts 2 Registration date Thursday July 30, 2015 Status Member Last seen July 30, 2015 - Jul 30, 2015 at 01:10 PM
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 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Jul 30, 2015 at 11:05 AM
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
0
looneybin Posts 2 Registration date Thursday July 30, 2015 Status Member Last seen July 30, 2015
Jul 30, 2015 at 01:10 PM
thank you so much that works a treat
0