### [Solved] Sorting sheets alphabetically minus the first 3

Posted:

**Thu Jan 07, 2016 11:04 pm**I have a need to sort alphabetically the calc workbook sheets minus the first 3.

I found this macro that works ok in excel, but obviously it is not made for OO

Indeed I test this OO macro and sort alphabetically ok, but I don´t know how exclude the first 3 sheets.

Please can somebody help me to solve this problem? I tried many things but none works (I am a total newby ).

Thanks!

I found this macro that works ok in excel, but obviously it is not made for OO

- Code: Select all Expand viewCollapse view
`Sub SortTabs()`

For s = 4 To Sheets.Count - 1

For ss = s + 1 To Sheets.Count

If Sheets(ss).Name < Sheets(s).Name Then

Sheets(ss).Move Before:=Sheets(s)

End If

Next ss

Next s

End Sub

Indeed I test this OO macro and sort alphabetically ok, but I don´t know how exclude the first 3 sheets.

- Code: Select all Expand viewCollapse view
`REM ***** BASIC *****`

Sub Ordena_Hojas

If (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) Then

GlobalScope.BasicLibraries.LoadLibrary("Tools")

End If

Sheets = ThisComponent.Sheets

Names = Sheets.ElementNames

SortedList = BubbleSortList(Names) 'BubbleSortList is a macro in the Tools Library

for i = 0 to UBound(SortedList)

Sheets.MoveByName(SortedList(i), i)

next i

End Sub

Please can somebody help me to solve this problem? I tried many things but none works (I am a total newby ).

Thanks!