I posted earlier and got the following code to sort names across multiple sheets (thanks Pennysaver)
Sub SortDaysoftheWeek()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Select Case ws.Name
Case "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
With ws
.Activate
.Range("A6:G256").Sort Key1:=Range("A6"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End Select
Next ws
End Sub
However I've hit a problem. I've extended the sort down to row 500 to allow for further names being added in the future. Now when I run the code all the blank cells appear at the top of the sorted data.
How do I adjust this code to only sort rows that contain a name in column A?
Sub SortDaysoftheWeek()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
Select Case ws.Name
Case "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"
With ws
.Activate
.Range("A6:G256").Sort Key1:=Range("A6"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End Select
Next ws
End Sub
However I've hit a problem. I've extended the sort down to row 500 to allow for further names being added in the future. Now when I run the code all the blank cells appear at the top of the sorted data.
How do I adjust this code to only sort rows that contain a name in column A?