Hi All,
I have a Marco to sort columns B-E from row 5 down to 700, i want this to happen on each worksheet in the workbook (currently 45 but more might be added)
I have been trying to edit the code to apply to all worksheet as it was only set to one, but it doesn't seem to be working, any help would be fantastic.
Sub sort()
' sort Macro
Dim wksht As Worksheet
For Each wksht In Application.Worksheets
Selection.CurrentRegion.Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Range("B5:E700").Select
ActiveSheet.sort.SortFields.Clear
ActiveSheet.sort.SortFields.Add Key:= _
Range("B5"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveSheet.sort
.SetRange Range("B5:E17")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Next wksht
End Sub
thanks guys!!
(still new the forum so apologies if i broke any rules!)
Bookmarks