Thread: Inserting a tab
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 1,726
Default Inserting a tab

After inserting or deleting a sheet, ru this macro

Sub RenameSheets()
Dim i As Long
For i = 1 To Worksheets.Count
Worksheets(i).Name = i
Next i
For i = 1 To Worksheets.Count
Worksheets(i).Name = ColumnLetter(i)
Next i
End Sub

'-----------------------------------------------------------------
Function ColumnLetter(Col As Long)
'-----------------------------------------------------------------
Dim sColumn As String
On Error Resume Next
sColumn = Split(Columns(Col).Address(, False), ":")(1)
On Error GoTo 0
ColumnLetter = sColumn
End Function



--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


wrote in message
oups.com...
Presently I have a Workbook that contains about 120 tabs. They're all
named in Alphabetical order. A,B,C etc. They're all in order. My
problem is I need to insert a sheet between Z and AA. Therefore I need
the new sheet to be called AA and the old AA to be AB, the old AB to be
AC. . . etc. Each of these sheets have info on stores and it's
important that I have the stores in the correct order.

This is not a one time thing, it's possible I will have to remove a
sheet or two with time also.

Any ideas?

I did find chip pearson's sorting macro which is great but I really
need to mass rename almost all of my sheets (tabs).


Tracy