Microsoft Excel

Wednesday, July 05, 2006

Useful Macros

Macro to Sort WorkSheets in alphabetical order

Sub Sort_Sheets()
cnt = Sheets.Count
For i = 1 To cnt - 1
For j = i + 1 To cnt
If Sheets(j).Name < Sheets(i).Name Then
Sheets(j).Move before:=Sheets(i)
End If
Next
Next
End Sub

0 Comments:

Post a Comment

<< Home