ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to arrange worksheets in alphabetical order? (https://www.excelbanter.com/excel-worksheet-functions/236605-how-arrange-worksheets-alphabetical-order.html)

Rohit Rathi

How to arrange worksheets in alphabetical order?
 
Dear All

Please help me arrange sheets in alphabetical order.

Rohit


royUK[_20_]

How to arrange worksheets in alphabetical order?
 

This code might help,it's speed will depend on the number of sheets


Code:
--------------------

Sub SortSheets()
Dim I As Integer, J As Integer

For I = 1 To Sheets.Count - 1
For J = I + 1 To Sheets.Count
If UCase(Sheets(I).Name) UCase(Sheets(J).Name) Then
Sheets(J).Move Befo=Sheets(I)
End If
Next J
Next I
End Sub

--------------------


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site' (http://www.excel-it.com/)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=115087


Dave Peterson

How to arrange worksheets in alphabetical order?
 
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 he
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.)

Rohit Rathi wrote:

Dear All

Please help me arrange sheets in alphabetical order.

Rohit


--

Dave Peterson


All times are GMT +1. The time now is 05:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com