Generating next worksheet tab name

Paul at GTS

Board Regular
Joined
May 17, 2004
Messages
56
Office Version
  1. 365
Platform
  1. Windows
Have a work book with 12 worksheets - 1 per month called :
Jan 19, Feb 19,Mar 19 etc

I am trying to get a formula to read the next sheet in the series. I have it working fine when i manually input the next sheet number but would like say, Jan 19 to be able to calculate the next sheet name as Feb 19

Sheets are named exactly as shown 3 Letters, Space, 2 Numbers.

Any ideas ?

Thanks
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try this:
Code:
Sub CreateNextSheet()

    Dim lastName As String
    Dim nextName As String

'   Get name of last sheet
    lastName = Sheets(Sheets.Count).Name
    
'   Build name of next month
    nextName = Format(DateAdd("m", 1, DateValue(Left(lastName, 4) & "1, 20" & Right(lastName, 2))), "mmm yy")
    
'   Add new sheet
    Sheets.Add After:=Sheets(Sheets.Count)
    
'   Name sheet
    ActiveSheet.Name = nextName
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top