Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Hoflinger
 
Posts: n/a
Default sort tabs in a workbook other than one at a time with move or cop.

is there any way to sort worksheets other than using the move or copy option?
How to alphabetize multiple sheets at one time.
  #2   Report Post  
Bony Pony
 
Posts: n/a
Default

Try this:


Sub Sort_Active_Book()
Dim i As Integer
Dim j As Integer
Dim iAnswer As VbMsgBoxResult
' Prompt the User as to which direction they want to sort
the worksheets.
iAnswer = MsgBox("Sort sheets in Ascending Order?" & Chr
(10) & "Clicking NO will sort in DESCENDING order",
vbYesNoCancel + vbQuestion + vbDefaultButton1, "Sort
Worksheets")
For i = 1 To Sheets.Count
For j = 1 To Sheets.Count - 1
' If answer is YES, sort ASCENDING
If iAnswer = vbYes Then
If UCase$(Sheets(j).Name) UCase$(Sheets(j + 1).Name)
Then Sheets(j).Move After:=Sheets(j + 1)
End If


' If Answer is NO, sort DESCENDING

If iAnswer = vbNo Then
If UCase$(Sheets(j).Name) < UCase$(Sheets(j + 1).Name)
Then Sheets(j).Move After:=Sheets(j + 1)
End If


Next j
Next i


End Sub


It's not mine but it works

Good luck!
-----Original Message-----
is there any way to sort worksheets other than using the

move or copy option?
How to alphabetize multiple sheets at one time.
.

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 tabs in a workbook other than one at a time with move or cop. Hoflinger Excel Worksheet Functions 3 September 17th 06 03:38 AM
Stubborn toolbars in Excel 007 Excel Discussion (Misc queries) 9 December 11th 04 03:02 PM
move the worksheet tabs in a workbook to left Boriss Excel Discussion (Misc queries) 1 December 6th 04 09:28 PM
In Excel can I move the tabs to the left side of the workbook? kit Excel Worksheet Functions 1 December 6th 04 09:15 PM
Workbook Tabs Graham Parkinson Excel Discussion (Misc queries) 2 December 2nd 04 04:07 PM


All times are GMT +1. The time now is 10:55 PM.

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"