View Single Post
 
Old 04-26-2021, 03:47 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2019
Expert
 
Join Date: Apr 2014
Posts: 956
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

…and shorter:
Code:
Sub InsertNewWorksheetAndName()
Application.ScreenUpdating = False
With ActiveWorkbook
  .Sheets.Add(After:=.Worksheets(.Worksheets.Count)).Name = Format(DateAdd("M", -1, Now()), "YYYY-MM")
End With
Application.ScreenUpdating = True
End Sub
Reply With Quote