New sheet tab creation issue in excel

Brass Contributor
New sheet tab creation issue
There are 15 tabs in the excel sheet( it is an already saved excel sheet on the desktop as ABC.xlsx). Out the 15 sheet tabs, i have deleted sheet4,sheet6,sheet11and sheet 13.

Now my sheet selection is on sheet2.when i click on new sheet option(+) the new sheets created are sheet4,sheet6, sheet11 and sheet13, i want the new sheets to start from sheet16 instead it is creating all the old deleted sheets first..why?

Please help me
1 Reply

@Raj_123 

You might use a macro to insert a new sheet:

 

Sub NewSheet()
    Dim wsh As Worksheet
    Dim OldName As String
    Dim p As Long
    Dim n As Long
    Dim m As Long
    For Each wsh In Worksheets
        OldName = wsh.Name
        For p = Len(OldName) To 1 Step -1
            If Not IsNumeric(Mid(OldName, p, 1)) Then
                Exit For
            End If
        Next p
        n = Val(Mid(OldName, p + 1))
        If n > m Then m = n
    Next wsh
    Worksheets.Add.Name = "Sheet" & m + 1
End Sub

 

 

You can assign the macro to a custom keyboard shortcut and/or to a Quick Access Toolbar button.