Wednesday, July 6, 2022

How to create worksheets in VBA Excel "Microsoft Excel Objects"

 Sub RenameSheet()

Dim Countsheets As Integer

Countsheets = Worksheets.Count

For i = 1 To 4

Worksheets.Add after:=Worksheets(Countsheets + i - 1)

Worksheets(Countsheets + i).Name = "2018 Q" & i

Next i

End Sub

No comments:

Post a Comment