Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 148
Default is it possible to alphabetize tabs and how?

i have over 70 tabs created in an Excel file all named with surnames, is
there a way to sort them into an alphabetical order. I have tried searching
in different areas to see if it can be done but no luck so far.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default is it possible to alphabetize tabs and how?

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.)



Heather wrote:

i have over 70 tabs created in an Excel file all named with surnames, is
there a way to sort them into an alphabetical order. I have tried searching
in different areas to see if it can be done but no luck so far.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 148
Default is it possible to alphabetize tabs and how?

Thanks Dave, wasnt' sure how to execute but initially recorded a macro with
name etc, stopped macro then went to edit the macro. for ease i copied and
pasted the information to add then ran the macro. worked a treat.

Heather

"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 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.)



Heather wrote:

i have over 70 tabs created in an Excel file all named with surnames, is
there a way to sort them into an alphabetical order. I have tried searching
in different areas to see if it can be done but no luck so far.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default is it possible to alphabetize tabs and how?

I had the same need as Heather. I copied the code from Chips site & pasted it
into a module in my PERSONAL.XLS. How do I run it? It doesn't show in the
ToolsMacros list,but shows up in my Project explorer. I'm not sure how to
handle Public Function code.....?
--
DanaK


"Heather" wrote:

i have over 70 tabs created in an Excel file all named with surnames, is
there a way to sort them into an alphabetical order. I have tried searching
in different areas to see if it can be done but no luck so far.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default is it possible to alphabetize tabs and how?

Did you put the code in a General module in your personal.xls's project?

Did you mark the subroutine Private?
Like:
Private Sub ProcToSort()

Did you mark the module Private?
Option Private Module
(at the top of the module)



DanaK wrote:

I had the same need as Heather. I copied the code from Chips site & pasted it
into a module in my PERSONAL.XLS. How do I run it? It doesn't show in the
ToolsMacros list,but shows up in my Project explorer. I'm not sure how to
handle Public Function code.....?
--
DanaK

"Heather" wrote:

i have over 70 tabs created in an Excel file all named with surnames, is
there a way to sort them into an alphabetical order. I have tried searching
in different areas to see if it can be done but no luck so far.


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default is it possible to alphabetize tabs and how?

Dave- I did put the code into a General module. I did NOT mark the subroutine
Private ( : * not sure what that means!) & ditto for mark the module Private.
I tried from your examples, but it didn't work. I must not be putting it in
the right place. The code begins with :

Public Function SortWorksheetsByName(ByVal FirstToSort As Long, ByVal
LastToSort As Long, _
ByRef ErrorText As String, Optional ByVal SortDescending As Boolean =
False) As Boolean

And then lots of other code....How do I know where/what to put? It's STILL
not showing up anywhere in my macros lists.

Thanks!
--
DanaK


"Dave Peterson" wrote:

Did you put the code in a General module in your personal.xls's project?

Did you mark the subroutine Private?
Like:
Private Sub ProcToSort()

Did you mark the module Private?
Option Private Module
(at the top of the module)



DanaK wrote:

I had the same need as Heather. I copied the code from Chips site & pasted it
into a module in my PERSONAL.XLS. How do I run it? It doesn't show in the
ToolsMacros list,but shows up in my Project explorer. I'm not sure how to
handle Public Function code.....?
--
DanaK

"Heather" wrote:

i have over 70 tabs created in an Excel file all named with surnames, is
there a way to sort them into an alphabetical order. I have tried searching
in different areas to see if it can be done but no luck so far.


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default is it possible to alphabetize tabs and how?

Functions don't show up in that dialog--only Subs.

So you can create a subroutine that sorts your worksheets:

Option Explicit
sub SortAllWorksheets()
dim ok as boolean
ok = sortworksheetsbyname(firsttosort:=1, _
lasttosort:=activeworkbook.sheets.count, _
errortext:="Error", _
sortdescending:=false)
msgbox "ok"
end sub

Marking the routine private just means that you have the word "Private" in front
of the first line:

Private Sub SortAllWorksheets()
or
Private Function sortworksheetsbyname(...)

But you'll notice that Chip marked his function Public.



DanaK wrote:

Dave- I did put the code into a General module. I did NOT mark the subroutine
Private ( : * not sure what that means!) & ditto for mark the module Private.
I tried from your examples, but it didn't work. I must not be putting it in
the right place. The code begins with :

Public Function SortWorksheetsByName(ByVal FirstToSort As Long, ByVal
LastToSort As Long, _
ByRef ErrorText As String, Optional ByVal SortDescending As Boolean =
False) As Boolean

And then lots of other code....How do I know where/what to put? It's STILL
not showing up anywhere in my macros lists.

Thanks!
--
DanaK

"Dave Peterson" wrote:

Did you put the code in a General module in your personal.xls's project?

Did you mark the subroutine Private?
Like:
Private Sub ProcToSort()

Did you mark the module Private?
Option Private Module
(at the top of the module)



DanaK wrote:

I had the same need as Heather. I copied the code from Chips site & pasted it
into a module in my PERSONAL.XLS. How do I run it? It doesn't show in the
ToolsMacros list,but shows up in my Project explorer. I'm not sure how to
handle Public Function code.....?
--
DanaK

"Heather" wrote:

i have over 70 tabs created in an Excel file all named with surnames, is
there a way to sort them into an alphabetical order. I have tried searching
in different areas to see if it can be done but no luck so far.


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default is it possible to alphabetize tabs and how?

Dave- Thanks for the lesson! The sub routine allows me to run
SortWorksheetsByName so that worked. Unfortunately I get a compile error- Sub
or Function not defined at this line- B = TestFirstLastSort(FirstToSort,
LastToSort, ErrorText)
I copied the code straight off Chips site, but I'll go back & try it again.
Thanks again!!

--
DanaK


"Dave Peterson" wrote:

Functions don't show up in that dialog--only Subs.

So you can create a subroutine that sorts your worksheets:

Option Explicit
sub SortAllWorksheets()
dim ok as boolean
ok = sortworksheetsbyname(firsttosort:=1, _
lasttosort:=activeworkbook.sheets.count, _
errortext:="Error", _
sortdescending:=false)
msgbox "ok"
end sub

Marking the routine private just means that you have the word "Private" in front
of the first line:

Private Sub SortAllWorksheets()
or
Private Function sortworksheetsbyname(...)

But you'll notice that Chip marked his function Public.



DanaK wrote:

Dave- I did put the code into a General module. I did NOT mark the subroutine
Private ( : * not sure what that means!) & ditto for mark the module Private.
I tried from your examples, but it didn't work. I must not be putting it in
the right place. The code begins with :

Public Function SortWorksheetsByName(ByVal FirstToSort As Long, ByVal
LastToSort As Long, _
ByRef ErrorText As String, Optional ByVal SortDescending As Boolean =
False) As Boolean

And then lots of other code....How do I know where/what to put? It's STILL
not showing up anywhere in my macros lists.

Thanks!
--
DanaK

"Dave Peterson" wrote:

Did you put the code in a General module in your personal.xls's project?

Did you mark the subroutine Private?
Like:
Private Sub ProcToSort()

Did you mark the module Private?
Option Private Module
(at the top of the module)



DanaK wrote:

I had the same need as Heather. I copied the code from Chips site & pasted it
into a module in my PERSONAL.XLS. How do I run it? It doesn't show in the
ToolsMacros list,but shows up in my Project explorer. I'm not sure how to
handle Public Function code.....?
--
DanaK

"Heather" wrote:

i have over 70 tabs created in an Excel file all named with surnames, is
there a way to sort them into an alphabetical order. I have tried searching
in different areas to see if it can be done but no luck so far.

--

Dave Peterson


--

Dave Peterson

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
How to alphabetize worksheet tabs? joyfulnoiz Excel Discussion (Misc queries) 5 October 31st 07 05:51 PM
is it possible to alphabetize worksheet tabs? mel Excel Worksheet Functions 1 February 27th 07 12:50 AM
alphabetize tabs MarkT Excel Discussion (Misc queries) 4 October 12th 06 03:27 PM
Simplest way to alphabetize sheet tabs Bro23 Excel Discussion (Misc queries) 3 June 21st 06 07:57 PM
How to Alphabetize Worksheet Tabs? campbti New Users to Excel 0 March 10th 05 05:21 PM


All times are GMT +1. The time now is 10:03 AM.

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

About Us

"It's about Microsoft Excel"