• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Renaming the Sheets in ascending order

I have data in the workbook, with 46 sheets. And I want to rename the sheet, starting from January 2016, to may 2019. Need VBA for the same. Format - January, February and so on.
 

vletm

Excel Ninja
Abhishek Pratap Singh
First You would like to rename sheets from January 2016 to may 2019.
Next ... You would like to rename those with format from January ... May ... hmm?
There can be once sheet names.
Do ALL sheets will rename?
 

Marc L

Excel Ninja
Restart from here (see in particular How to get the Best Results) :​
 

Keetoowah

New Member
Hi Abhishek Pratap Singh,
try this code:

Code:
Sub RenameSheets()

    Dim ws     As Worksheet
    Dim i      As Integer
    Dim StartDate As Date

    StartDate = "01/01/2016"
    
    For i = 1 To ThisWorkbook.Worksheets.Count
        
        ThisWorkbook.Worksheets(i).Name = MonthName(Month(StartDate)) & " " & Year(StartDate)
        StartDate = DateAdd("m", 1, StartDate)
        Next
    End Sub
 
Top