S
Sean
Routine below does a couple of things but the line I'm trying to
tweak, is after it creates a new sheet with the sheet number, it names
it for example xxxx #13, how can I get it to rename as xxxx # 13. In
other words a space between the number and the #
Thanks
Sub copysheet()
Dim i As Integer
Application.ScreenUpdating = False
i = Sheets.Count
Sheets(i).Select
sheetname = ActiveSheet.Name
sheetnumber = Val(Trim(Mid(sheetname, InStr(sheetname, "#") + 1)))
sheetnumber = sheetnumber + 1
sheetprefix = Trim(Left(sheetname, InStr(sheetname, "#")))
ActiveSheet.Copy after:=Sheets(ActiveSheet.Index)
ActiveSheet.Name = sheetprefix & sheetnumber
If sheetnumber Mod 2 = 0 Then
ActiveSheet.Tab.ColorIndex = 6
Else
ActiveSheet.Tab.ColorIndex = 41
End If
ActiveWindow.Zoom = 75
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayHeadings = False
End Sub
tweak, is after it creates a new sheet with the sheet number, it names
it for example xxxx #13, how can I get it to rename as xxxx # 13. In
other words a space between the number and the #
Thanks
Sub copysheet()
Dim i As Integer
Application.ScreenUpdating = False
i = Sheets.Count
Sheets(i).Select
sheetname = ActiveSheet.Name
sheetnumber = Val(Trim(Mid(sheetname, InStr(sheetname, "#") + 1)))
sheetnumber = sheetnumber + 1
sheetprefix = Trim(Left(sheetname, InStr(sheetname, "#")))
ActiveSheet.Copy after:=Sheets(ActiveSheet.Index)
ActiveSheet.Name = sheetprefix & sheetnumber
If sheetnumber Mod 2 = 0 Then
ActiveSheet.Tab.ColorIndex = 6
Else
ActiveSheet.Tab.ColorIndex = 41
End If
ActiveWindow.Zoom = 75
ActiveWindow.DisplayGridlines = False
ActiveWindow.DisplayHeadings = False
End Sub