If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
alphabetize worksheet names
Is there a way to alphabetize worksheet names in a workbook without having to
manually move each one? |
#2
|
|||
|
|||
alphabetize worksheet names
This would require using VBA (which is programming)...
-- Wag more, bark less "Eve Z." wrote: Is there a way to alphabetize worksheet names in a workbook without having to manually move each one? |
#3
|
|||
|
|||
alphabetize worksheet names
Chip Pearson and David McRitchie share code to sort sheets:
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.) Eve Z. wrote: Is there a way to alphabetize worksheet names in a workbook without having to manually move each one? -- Dave Peterson |
#4
|
|||
|
|||
alphabetize worksheet names
Hi Eve
As Brad rightly says, this would require you to write a VBA sub procedure. If you have a copy of John Walkenbach's excellent book "Excel 2002 Power Programming with VBA" John actually uses this very subject as an example of how to plan and build a VBA sub procedure. It starts on page 241 of his book, and the finished procedure is listed on pages 253 & 254. Regards John WEC "Eve Z." wrote: Is there a way to alphabetize worksheet names in a workbook without having to manually move each one? |
#5
|
|||
|
|||
alphabetize worksheet names
try this
Sub Sortem() For x = 1 To Worksheets.Count For y = x To Worksheets.Count If UCase(Sheets(y).Name) UCase(Sheets(x).Name) Then Sheets(y).Move Befo=Sheets(x) End If Next Next End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Eve Z." wrote: Is there a way to alphabetize worksheet names in a workbook without having to manually move each one? |
Thread Tools | |
Display Modes | |
|
|