#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Inserting a tab

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Inserting a tab

As long as you're using less than 256 worksheets (or 16384 with xl2007), this
macro would do the renames:

Option Explicit
Sub testme()
Dim wCtr As Long
Dim myName As String
For wCtr = 1 To Worksheets.Count
Worksheets(wCtr).Name = "Unique__" & wCtr
Next wCtr

For wCtr = 1 To Worksheets.Count
myName = Worksheets(1).Cells(1, wCtr).Address(0, 0)
myName = Left(myName, Len(myName) - 1)
Worksheets(wCtr).Name = myName
Next wCtr
End Sub

It renames each sheet to a new name, then renames those names to the final name.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

wrote:

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


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Inserting a tab

I totally agree on renaming the tabs as significant names. I am
actually going to recomment to my user that he do that but he might not
be willing, therefore I need a backup plan.


Tracy

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting rows between each entry Brablo Excel Discussion (Misc queries) 2 September 13th 06 11:33 PM
Inserting new data before "calculating cells" is done??? Fecozisk Excel Discussion (Misc queries) 3 July 19th 06 03:19 AM
inserting rows in linked worksheets mark Excel Discussion (Misc queries) 1 February 13th 06 07:04 AM
Inserting a number and having it displayed as you typed Bev New Users to Excel 2 August 23rd 05 01:54 AM
Inserting Footer - Ajit Ajit Munj Excel Discussion (Misc queries) 2 March 11th 05 02:39 PM


All times are GMT +1. The time now is 09:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"