Hi there
I'm fairly new to VBA so please be patient with me I have a workbook that will have 60+ sheets. These will be named with clients names, then I have my working sheets. I am trying to sort my workbook by sorting alphabetically those tabs with a "," only but I can't get the script to work
Here is what I have:
Sub SortSheets()
Dim ws As Worksheet
Dim ShCount As Integer, i As Integer, j As Integer
Application.DisplayAlerts = False
For Each ws In Worksheets
ShCount = Sheets.Count
Next
For i = 1 To ShCount - 1
For j = i + 1 To ShCount
if( Sheets(j).ws.Name(",") > ( Sheets(i)ws.Name(",")) Then
Sheets(j).Move before:=Sheets(i)
End If
Next j
Next i
Application.DisplayAlerts = True
End Sub
Any help would be very much appreciated.
Thank you
I'm fairly new to VBA so please be patient with me I have a workbook that will have 60+ sheets. These will be named with clients names, then I have my working sheets. I am trying to sort my workbook by sorting alphabetically those tabs with a "," only but I can't get the script to work
Here is what I have:
Sub SortSheets()
Dim ws As Worksheet
Dim ShCount As Integer, i As Integer, j As Integer
Application.DisplayAlerts = False
For Each ws In Worksheets
ShCount = Sheets.Count
Next
For i = 1 To ShCount - 1
For j = i + 1 To ShCount
if( Sheets(j).ws.Name(",") > ( Sheets(i)ws.Name(",")) Then
Sheets(j).Move before:=Sheets(i)
End If
Next j
Next i
Application.DisplayAlerts = True
End Sub
Any help would be very much appreciated.
Thank you