Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Sort the Tabs

Hi,

Is it possible to write a VBA to sort all the TABS base on their names ?

Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Sort the Tabs

Hi A-Design,

Try Chip Pearson's code:


Sub AlphaSortWorksheets()

Dim N As Integer
Dim M As Integer
Dim FirstWSToSort As Integer
Dim LastWSToSort As Integer
Dim SortDescending As Boolean

SortDescending = False
FirstWSToSort = 1
LastWSToSort = Worksheets.Count

For M = FirstWSToSort To LastWSToSort
For N = M To LastWSToSort
If SortDescending = True Then
If UCase(Worksheets(N).Name) _
UCase(Worksheets(M).Name) Then
Worksheets(N).Move befo=Worksheets(M)
End If
Else
If UCase(Worksheets(N).Name) < _
UCase(Worksheets(M).Name) Then
Worksheets(N).Move befo=Worksheets(M)
End If
End If
Next N
Next M

End Sub

---
Regards,
Norman



"A-Design" wrote in message
...
Hi,

Is it possible to write a VBA to sort all the TABS base on their names ?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Sort the Tabs

See www.cpearson.com/excel/sortws.htm for VBA code to do this.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"A-Design" wrote in message
...
Hi,

Is it possible to write a VBA to sort all the TABS base on
their names ?

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Sort the Tabs

Thank you so much for your helps.


"Chip Pearson" wrote in message
...
See www.cpearson.com/excel/sortws.htm for VBA code to do this.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"A-Design" wrote in message
...
Hi,

Is it possible to write a VBA to sort all the TABS base on their names ?

Thanks.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Sort the Tabs

Thank you very much for replies.



"Chip Pearson" wrote in message
...
See www.cpearson.com/excel/sortws.htm for VBA code to do this.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"A-Design" wrote in message
...
Hi,

Is it possible to write a VBA to sort all the TABS base on their names ?

Thanks.





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
Sort Data Cross Tabs [email protected] Excel Worksheet Functions 4 October 17th 07 09:42 PM
how do I sort tabs on an excel spreadsheet Percy[_2_] Excel Worksheet Functions 5 March 13th 07 05:56 PM
Is it possible to sort the tabs in a workbook? Jules Excel Discussion (Misc queries) 1 August 3rd 06 07:49 PM
Sort tabs Stan Excel Discussion (Misc queries) 4 April 26th 06 06:18 PM
Re-Sort Worksheet tabs Campbti Excel Worksheet Functions 1 March 10th 05 05:16 PM


All times are GMT +1. The time now is 05:58 AM.

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

About Us

"It's about Microsoft Excel"