No much wonder you beat me to it shg
Here is my tuppence worth
Sub SortTables()
Dim LastRow As Long, LastCol As Long
Dim RowNo As Long, ColNo As Long
Dim rngTable As Range, rngSort As Range
On Error GoTo ResetApplication
Application.ScreenUpdating = False
Worksheets("Sheet1").Activate
LastRow = Range("B" & Rows.Count).End(xlUp).Row
LastCol = Cells(6, Columns.Count).End(xlToLeft).Column
For RowNo = 6 To LastRow Step 45
For ColNo = 2 To LastCol Step 15
Set rngTable = Range(Cells(RowNo, ColNo), Cells(RowNo + 39, ColNo + 13))
Set rngSort = Range(Cells(RowNo, ColNo), Cells(RowNo + 39, ColNo))
With Worksheets("Sheet1").Sort
.SortFields.Clear
.SortFields.Add Key:=rngSort, SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortNormal
.SetRange rngTable
.Header = xlNo
.Apply
End With
Next
Next
Range("B5").Select
ResetApplication:
On Error GoTo 0
Application.ScreenUpdating = True
Set rngTable = Nothing
Set rngSort = Nothing
End Sub
A bit late but never-the-less it's done now.
[EDIT]
And it's for 2007 and not 2003 that Dazzle is using.
Waken up Alistair!
Bookmarks