WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

is it possible to alphabetize tabs and how?

 
Goto page 1, 2
   Home -> Office -> General Discussions RSS
Next:  HELP to correc this macro  
Author Message
Heather

External


Since: Mar 04, 2006
Posts: 65



(Msg. 1) Posted: Mon Oct 27, 2008 5:14 pm
Post subject: is it possible to alphabetize tabs and how?
Archived from groups: microsoft>public>excel>misc (more info?)

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.
Back to top
Login to vote
Dave Peterson

External


Since: Jul 08, 2005
Posts: 9020



(Msg. 2) Posted: Mon Oct 27, 2008 7:38 pm
Post subject: Re: is it possible to alphabetize tabs and how? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You could use a macro...

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

David McRitchie's:
http://www.mvps.org/dmcritchie/excel/buildtoc.htm#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.)



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
Back to top
Login to vote
Heather

External


Since: Mar 04, 2006
Posts: 65



(Msg. 3) Posted: Mon Oct 27, 2008 7:38 pm
Post subject: Re: is it possible to alphabetize tabs and how? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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/buildtoc.htm#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.)
>
>
>
> 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
>
Back to top
Login to vote
DanaK

External


Since: Nov 18, 2008
Posts: 3



(Msg. 4) Posted: Tue Nov 18, 2008 7:45 pm
Post subject: RE: is it possible to alphabetize tabs and how? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
Tools>Macros 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.
Back to top
Login to vote
Dave Peterson

External


Since: Jul 08, 2005
Posts: 9020



(Msg. 5) Posted: Wed Nov 19, 2008 6:49 am
Post subject: Re: is it possible to alphabetize tabs and how? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
> Tools>Macros 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
Back to top
Login to vote
DanaK

External


Since: Nov 18, 2008
Posts: 3



(Msg. 6) Posted: Wed Nov 19, 2008 9:58 pm
Post subject: Re: is it possible to alphabetize tabs and how? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
> > Tools>Macros 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
>
Back to top
Login to vote
Dave Peterson

External


Since: Jul 08, 2005
Posts: 9020



(Msg. 7) Posted: Thu Nov 20, 2008 7:10 am
Post subject: Re: is it possible to alphabetize tabs and how? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
> > > Tools>Macros 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
Back to top
Login to vote
DanaK

External


Since: Nov 18, 2008
Posts: 3



(Msg. 8) Posted: Fri Nov 21, 2008 8:53 am
Post subject: Re: is it possible to alphabetize tabs and how? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
> > > > Tools>Macros 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
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> General Discussions All times are: Eastern Time (US & Canada) (change)
Goto page 1, 2
Page 1 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET