Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Techtrainer
 
Posts: n/a
Default Can you sort sheet tabs in a workbook

How can I sort the sheet tabs in my workbook
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Can you sort sheet tabs in a workbook

try

Sub SortALLSheetsbyName() 'McRitchie
'sort sheets within a workbook in Excel 7 -- Bill Manville
'modified to sort all sheets instead of just worksheets
Dim iSheet As Integer, iBefore As Integer
For iSheet = 1 To ActiveWorkbook.Sheets.Count
Sheets(iSheet).Visible = True
For iBefore = 1 To iSheet - 1
If UCase(Sheets(iBefore).Name) UCase(Sheets(iSheet).Name) Then
ActiveWorkbook.Sheets(iSheet).Move
Befo=ActiveWorkbook.Sheets(iBefore)
Exit For
End If
Next iBefore
Next iSheet
End Sub

--
Don Guillett
SalesAid Software

"Techtrainer" wrote in message
...
How can I sort the sheet tabs in my workbook



  #3   Report Post  
Posted to microsoft.public.excel.misc
Techtrainer
 
Posts: n/a
Default Can you sort sheet tabs in a workbook



"Techtrainer" wrote:

How can I sort the sheet tabs in my workbook


Thanks for the response!
I am getting an error thougn on the following line
ActiveWorkbook.Sheets(iSheet).Move
Befo=ActiveWorkbook.Sheets(iBefore)

Compiler doesn't seem to like :=
  #4   Report Post  
Posted to microsoft.public.excel.misc
Techtrainer
 
Posts: n/a
Default Can you sort sheet tabs in a workbook

Thank you!!
I wrote back about an error I was getting but it was just a syntax problem.
I got it corrected and it works fine.
Thank You !!!
Bill vernola

"Don Guillett" wrote:

try

Sub SortALLSheetsbyName() 'McRitchie
'sort sheets within a workbook in Excel 7 -- Bill Manville
'modified to sort all sheets instead of just worksheets
Dim iSheet As Integer, iBefore As Integer
For iSheet = 1 To ActiveWorkbook.Sheets.Count
Sheets(iSheet).Visible = True
For iBefore = 1 To iSheet - 1
If UCase(Sheets(iBefore).Name) UCase(Sheets(iSheet).Name) Then
ActiveWorkbook.Sheets(iSheet).Move
Befo=ActiveWorkbook.Sheets(iBefore)
Exit For
End If
Next iBefore
Next iSheet
End Sub

--
Don Guillett
SalesAid Software

"Techtrainer" wrote in message
...
How can I sort the sheet tabs in my workbook




  #5   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Can you sort sheet tabs in a workbook

The lines

ActiveWorkbook.Sheets(iSheet).Move
Befo=ActiveWorkbook.Sheets(iBefore)

should all be on one line in the code module.

See also www.cpearson.com/excel/sortws.htm for a procedure to
sort worksheets.

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



"Techtrainer" wrote in
message
...


"Techtrainer" wrote:

How can I sort the sheet tabs in my workbook


Thanks for the response!
I am getting an error thougn on the following line
ActiveWorkbook.Sheets(iSheet).Move
Befo=ActiveWorkbook.Sheets(iBefore)

Compiler doesn't seem to like :=





  #6   Report Post  
Posted to microsoft.public.excel.misc
Techtrainer
 
Posts: n/a
Default Can you sort sheet tabs in a workbook

Thanks Chip!

"Chip Pearson" wrote:

The lines

ActiveWorkbook.Sheets(iSheet).Move
Befo=ActiveWorkbook.Sheets(iBefore)

should all be on one line in the code module.

See also www.cpearson.com/excel/sortws.htm for a procedure to
sort worksheets.

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



"Techtrainer" wrote in
message
...


"Techtrainer" wrote:

How can I sort the sheet tabs in my workbook


Thanks for the response!
I am getting an error thougn on the following line
ActiveWorkbook.Sheets(iSheet).Move
Befo=ActiveWorkbook.Sheets(iBefore)

Compiler doesn't seem to like :=




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
Change sheet reference in new workbook [email protected] Excel Discussion (Misc queries) 2 January 26th 06 04:44 PM
Sheet tabs are hidden...option is checked okamico Excel Discussion (Misc queries) 4 January 12th 06 09:14 PM
printing multiple sheet tabs to image file 0492-Examiner Excel Discussion (Misc queries) 0 October 19th 05 10:43 PM
Copy sheet - Break Links to Old Workbook - Retain Formula. Mr Anonymouse Setting up and Configuration of Excel 1 October 15th 05 01:00 AM
Does excel recognise names rather than cells? Sue Excel Worksheet Functions 9 May 22nd 05 04:51 AM


All times are GMT +1. The time now is 12:43 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"