PC Review


Reply
Thread Tools Rate Thread

Alphabatizing my worksheets

 
 
John
Guest
Posts: n/a
 
      21st Feb 2009
What code might I use to sort all the worksheets except the master summary
sheet into alphabetic order? (The master summary sheet's tab name is unique
and I want it to always be the first tab in the workbook.)
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      21st Feb 2009
You could use a macro...

Chip Pearson's:
http://www.cpearson.com/excel/sortws.htm

David McRitchie's:
http://www.mvps.org/dmcritchie/excel...#sortallsheets

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

=======
And I'd just let the macro sort the mastersheet, too. Then after the sort, you
can add code to move it to the leftmost position.

Sheets("summary").Move before:=Sheets(1)

(change the name as required.)

John wrote:
>
> What code might I use to sort all the worksheets except the master summary
> sheet into alphabetic order? (The master summary sheet's tab name is unique
> and I want it to always be the first tab in the workbook.)


--

Dave Peterson
 
Reply With Quote
 
keiji kounoike
Guest
Posts: n/a
 
      21st Feb 2009
This is a very primitive one. But try it.

Sub sortsheetname()
Dim n As Long, i As Long
For n = Worksheets.Count To 1 Step -1
For i = 2 To n - 1
If Worksheets(i).Name > Worksheets(i + 1).Name Then
Worksheets(i).Move after:=Worksheets(i + 1)
End If
Next
Next
End Sub

Keiji

John wrote:
> What code might I use to sort all the worksheets except the master summary
> sheet into alphabetic order? (The master summary sheet's tab name is unique
> and I want it to always be the first tab in the workbook.)

 
Reply With Quote
 
John
Guest
Posts: n/a
 
      21st Feb 2009
This was a lot of help. Thx for all the additional links!

I appreciate your help, -John

"Dave Peterson" wrote:

> You could use a macro...
>
> Chip Pearson's:
> http://www.cpearson.com/excel/sortws.htm
>
> David McRitchie's:
> http://www.mvps.org/dmcritchie/excel...#sortallsheets
>
> If you're new to macros:
>
> Debra Dalgleish has some notes how to implement macros here:
> http://www.contextures.com/xlvba01.html
>
> David McRitchie has an intro to macros:
> http://www.mvps.org/dmcritchie/excel/getstarted.htm
>
> Ron de Bruin's intro to macros:
> http://www.rondebruin.nl/code.htm
>
> (General, Regular and Standard modules all describe the same thing.)
>
> =======
> And I'd just let the macro sort the mastersheet, too. Then after the sort, you
> can add code to move it to the leftmost position.
>
> Sheets("summary").Move before:=Sheets(1)
>
> (change the name as required.)
>
> John wrote:
> >
> > What code might I use to sort all the worksheets except the master summary
> > sheet into alphabetic order? (The master summary sheet's tab name is unique
> > and I want it to always be the first tab in the workbook.)

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Favorites Re-Alphabatizing themselves =?Utf-8?B?RWwgRGlhYmxvIFdvb2tpZQ==?= Windows XP Internet Explorer 0 5th Apr 2005 12:37 PM
Alphabatizing Combo Boxes =?Utf-8?B?RGF2ZSBNYXJkZW4=?= Microsoft Excel Programming 3 27th Sep 2004 08:35 AM
Alphabatizing Contacts =?Utf-8?B?Q2FycmllVA==?= Microsoft Outlook Contacts 4 31st May 2004 05:36 AM
ALPHABATIZING FAVORITES LIST SAL Microsoft Windows 2000 Active Directory 1 23rd Apr 2004 09:44 PM
Data keeps alphabatizing Jess Microsoft Access Database Table Design 2 23rd Mar 2004 09:34 PM


Features
 

Advertising
 

Newsgroups
 


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