Thread: Sort Worksheets
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
eliano[_2_] eliano[_2_] is offline
external usenet poster
 
Posts: 79
Default Sort Worksheets

Hi Patrick.

see Chip Pearson at:


http://www.cpearson.com/excel/sortws.htm


my friend Norman Jones proposed a little variation to the good Chip
code:

instead of:
-----------------------------------------------------------------
If SortDescending = True Then
If UCase(Worksheets(N).Name) UCase(Worksheets(M).Name) Then
Worksheets(N).Move Befo=Worksheets(M)
End If
Else
If UCase(Worksheets(N).Name) < UCase(Worksheets(M).Name) Then
Worksheets(N).Move Befo=Worksheets(M)
End If
End If
-----------------------------------------------------------------

try:

If (UCase(Worksheets(N).Name) UCase(Worksheets(M).Name)) = _
SortDescending Then
Worksheets(N).Move Befo=Worksheets(M)
End If

Regards
Eliano


On 24 Feb, 02:25, "Patrick C. Simonds" wrote:
Is there any way (using VBA code) to place all WorkSheets in a WorkBook in
alphabetical order?