A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

alphabetize worksheet names



 
 
Thread Tools Display Modes
  #1  
Old May 13th, 2010, 08:38 PM posted to microsoft.public.excel.misc
Eve Z.
external usenet poster
 
Posts: 1
Default alphabetize worksheet names

Is there a way to alphabetize worksheet names in a workbook without having to
manually move each one?
  #2  
Old May 13th, 2010, 08:43 PM posted to microsoft.public.excel.misc
Brad
external usenet poster
 
Posts: 943
Default 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  
Old May 13th, 2010, 08:57 PM posted to microsoft.public.excel.misc
Dave Peterson[_2_]
external usenet poster
 
Posts: 69
Default 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  
Old May 13th, 2010, 09:14 PM posted to microsoft.public.excel.misc
John WEC
external usenet poster
 
Posts: 7
Default 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  
Old May 13th, 2010, 09:43 PM posted to microsoft.public.excel.misc
Mike H
external usenet poster
 
Posts: 8,419
Default 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

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:00 PM.


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