Created
September 22, 2019 21:28
-
-
Save Tomamais/7267c66e97a79497e8579db89372a622 to your computer and use it in GitHub Desktop.
Classificar Planilhas Alfabeticamente
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'source: https://qr.ae/TWs7hb | |
'author: Chip Pearson | |
Sub SortWorksheets() | |
Dim i As Long, j As Long, n As Long | |
Dim ws As Worksheet | |
Application.ScreenUpdating = False | |
With ActiveWorkbook | |
n = .Worksheets.Count | |
If n > 1 Then | |
For i = 2 To n | |
For j = 2 To n | |
If .Worksheets(j).Name < .Worksheets(j - 1).Name Then .Worksheets(j).Move Before:=.Worksheets(j - 1) | |
Next | |
Next | |
End If | |
End With | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment