ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Alphabetizing Tabs (https://www.excelbanter.com/excel-discussion-misc-queries/116221-alphabetizing-tabs.html)

drugfighter

Alphabetizing Tabs
 
I inhereted an excell database recently that has a gazillion tabs on the
bottom for each worksheet (I'm not sure if the terminology is correct). At
any rate, I'm wondering if there is any way to get these bottom tabs in some
sort of order alphabetically. Searching through them is a real pain the way
it is.

tim m

Alphabetizing Tabs
 
I don't know how to alphabetize or sort these but an easier way to view tabs
when you have alot of them is to right click on the arrows just to the left
of the start of the tab names, this brings up a vertical window with all the
tab names and makes it much easier to navigate them.

"drugfighter" wrote:

I inhereted an excell database recently that has a gazillion tabs on the
bottom for each worksheet (I'm not sure if the terminology is correct). At
any rate, I'm wondering if there is any way to get these bottom tabs in some
sort of order alphabetically. Searching through them is a real pain the way
it is.


Ken

Alphabetizing Tabs
 
I could use this too ... I have a utility that does it for me ... so I know
the code writers can do this ... What I need in addition, is code that will
not only sort the TabSheets by name, but will allow me to suppress sorting
"x" number of TabSheets at the front of the workbook ... I will be waiting to
see the answers here from the Wizards of these boards ... Thanks ... Kha

"tim m" wrote:

I don't know how to alphabetize or sort these but an easier way to view tabs
when you have alot of them is to right click on the arrows just to the left
of the start of the tab names, this brings up a vertical window with all the
tab names and makes it much easier to navigate them.

"drugfighter" wrote:

I inhereted an excell database recently that has a gazillion tabs on the
bottom for each worksheet (I'm not sure if the terminology is correct). At
any rate, I'm wondering if there is any way to get these bottom tabs in some
sort of order alphabetically. Searching through them is a real pain the way
it is.


Gord Dibben

Alphabetizing Tabs
 
http://www.cpearson.com/excel/sortws.htm

Chip Pearson has code that will sort the sheets.

OR you can use Bob Phillips' browsesheets macro that pops up a list of all
sheets to select from.

Sub BrowseSheets()
Const nPerColumn As Long = 38 'number of items per column
Const nWidth As Long = 13 'width of each letter
Const nHeight As Long = 18 'height of each row
Const sID As String = "___SheetGoto" 'name of dialog sheet
Const kCaption As String = " Select sheet to goto"
'dialog caption


Dim i As Long
Dim TopPos As Long
Dim iBooks As Long
Dim cCols As Long
Dim cLetters As Long
Dim cMaxLetters As Long
Dim cLeft As Long
Dim thisDlg As DialogSheet
Dim CurrentSheet As Worksheet
Dim cb As OptionButton
Application.ScreenUpdating = False
If ActiveWorkbook.ProtectStructure Then
MsgBox "Workbook is protected.", vbCritical
Exit Sub
End If
On Error Resume Next
Application.DisplayAlerts = False
ActiveWorkbook.DialogSheets(sID).Delete
Application.DisplayAlerts = True
On Error GoTo 0
Set CurrentSheet = ActiveSheet
Set thisDlg = ActiveWorkbook.DialogSheets.Add
With thisDlg
.Name = sID
.Visible = xlSheetHidden
'sets variables for positioning on dialog
iBooks = 0
cCols = 0
cMaxLetters = 0
cLeft = 78
TopPos = 40
For i = 1 To ActiveWorkbook.Worksheets.Count
If i Mod nPerColumn = 1 Then
cCols = cCols + 1
TopPos = 40
cLeft = cLeft + (cMaxLetters * nWidth)
cMaxLetters = 0
End If
Set CurrentSheet = ActiveWorkbook.Worksheets(i)
cLetters = Len(CurrentSheet.Name)
If cLetters cMaxLetters Then
cMaxLetters = cLetters
End If
iBooks = iBooks + 1
.OptionButtons.Add cLeft, TopPos, cLetters * nWidth, 16.5
.OptionButtons(iBooks).text = _
ActiveWorkbook.Worksheets(iBooks).Name
TopPos = TopPos + 13
Next i
.Buttons.Left = cLeft + (cMaxLetters * nWidth) + 24
CurrentSheet.Activate
With .DialogFrame
.Height = Application.Max(68, _
Application.Min(iBooks, nPerColumn) * nHeight + 10)
.Width = cLeft + (cMaxLetters * nWidth) + 24
.Caption = kCaption
End With
.Buttons("Button 2").BringToFront
.Buttons("Button 3").BringToFront
Application.ScreenUpdating = True
If .Show Then
For Each cb In thisDlg.OptionButtons
If cb.Value = xlOn Then
ActiveWorkbook.Worksheets(cb.Caption).Select
Exit For
End If
Next cb
Else
MsgBox "Nothing selected"
End If
Application.DisplayAlerts = False
.Delete
End With
End Sub


Gord Dibben MS Excel MVP


On Thu, 26 Oct 2006 08:29:01 -0700, Ken wrote:

I could use this too ... I have a utility that does it for me ... so I know
the code writers can do this ... What I need in addition, is code that will
not only sort the TabSheets by name, but will allow me to suppress sorting
"x" number of TabSheets at the front of the workbook ... I will be waiting to
see the answers here from the Wizards of these boards ... Thanks ... Kha

"tim m" wrote:

I don't know how to alphabetize or sort these but an easier way to view tabs
when you have alot of them is to right click on the arrows just to the left
of the start of the tab names, this brings up a vertical window with all the
tab names and makes it much easier to navigate them.

"drugfighter" wrote:

I inhereted an excell database recently that has a gazillion tabs on the
bottom for each worksheet (I'm not sure if the terminology is correct). At
any rate, I'm wondering if there is any way to get these bottom tabs in some
sort of order alphabetically. Searching through them is a real pain the way
it is.




All times are GMT +1. The time now is 11:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com