Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sorting sheets
Hi All,
I have a workbook with several sheets. Each sheet is named by an employee ID number. I want to sort the sheets according to the position of each group of employee. Is there a way to sort sheets? (A-Z or customize) Thanks in advance |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sorting sheets
Sub sortsheets()
'Re-Sort sheet names ' Thanks to McRitchie & Bill Manville Dim iSheet As Integer Dim iBefore As Integer For iSheet = 1 To Worksheets.Count For iBefore = 1 To iSheet - 1 If UCase(Sheets(iBefore).Name) UCase(Sheets(iSheet).Name) Then Sheets(iSheet).Move befo=Sheets(iBefore) Exit For End If Next iBefore Next iSheet End Sub HTH -- AP "Lp12" a écrit dans le message de news: ... Hi All, I have a workbook with several sheets. Each sheet is named by an employee ID number. I want to sort the sheets according to the position of each group of employee. Is there a way to sort sheets? (A-Z or customize) Thanks in advance |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sorting sheets
That was an alpha sort.
For a numeric sort: '------------------------------------------------------------------------------- Sub sortsheets() 'Re-Sort sheet names ' Thanks to McRitchie & Bill Manville Dim iSheet As Integer Dim iBefore As Integer For iSheet = 1 To Worksheets.Count For iBefore = 1 To iSheet - 1 If CInt(Sheets(iBefore).Name) CInt(Sheets(iSheet).Name) Then Sheets(iSheet).Move befo=Sheets(iBefore) Exit For End If Next iBefore Next iSheet End Sub |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sorting sheets
You need to use a VBA procedure. See
www.cpearson.com/excel/sortws.htm for example code. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Lp12" wrote in message ... Hi All, I have a workbook with several sheets. Each sheet is named by an employee ID number. I want to sort the sheets according to the position of each group of employee. Is there a way to sort sheets? (A-Z or customize) Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sorting master sheet messes up cells in other sheets linked to it | Excel Worksheet Functions | |||
sorting master sheet messes up cells in other sheets linked to it | Excel Worksheet Functions | |||
Sorting Data from 2 sheets, one sheet which is already sorted | Excel Worksheet Functions | |||
Linking sheets when sorting row and column data | Excel Worksheet Functions | |||
Sorting Data to Different Sheets | Excel Worksheet Functions |