Views

Histats

Vitrine

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


Podemos ordenar todas as planilhas numa seqüência alfabética, enquanto os ícones por worksheet não vem.

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

Tags: Excel, worksheets, sheets, ws, insert, inserindo, sort, ordena


André Luiz Bernardes
A&A® - Work smart, not hard.

✔ VBA Brazil®

✔ VBA Brazil®
brazilsalesforceeffectiveness@gmail.com
Related Posts Plugin for WordPress, Blogger...
diHITT - Notícias