VBA Excel - Ordena worksheets da planilha - Sort All Sheets in a Workbook

Inline image 1

Podemos ordenar todas as Sheets duma seqüência alfabética.

Sub SrtShs()
Dim iSheet As Long, iBefore As Long 
For iSheet = 1 To ActiveWorkbook.Sheets.Count     
    Let Sheets(iSheet).Visible = True 
    For iBefore = 1 To iSheet - 1       
        If UCase(Sheets(iBefore).Name) & UCase(Sheets(iSheet).Name) Then  
                      ActiveWorkbook.Sheets(iSheet).Move 
          Before:=ActiveWorkbook.Sheets(iBefore)         
          Exit For       
        End If     
    Next iBefore   
Next iSheet 
End Sub







Reference:

Inspiration:

TagsVBA, Excel, wrap, sheet, sheets, ws, insert, sort, ordena


Nenhum comentário:

Postar um comentário

diHITT - Notícias