Hi
I need some help please. Although I have used excel for years, I have never actually used it in-depth so am a novice sorry.
I have put together a spreadsheet containing all the results of my teams bowling results for this season which I have finally got working correctly. The results then feed into another sheet to produce a league table.
My problem is that I have tried to make a macro to autosort the table whenever something is changed in the resluts sheet. The macro works great if I use the shortcut key I put in but it doesnt do it automatically which is what I want but dont know how to do.
My macro is
Private Sub Worksheet_Change(ByVal Target As Range)
Macro8()
'
' Macro8 Macro
'
'
Range("A5:Y28").Select
ActiveWorkbook.Worksheets("Averages").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Averages").Sort.SortFields.Add Key:=Range("E5:E28" _
), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Averages").Sort.SortFields.Add Key:=Range("I5:I28" _
), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Averages").Sort
.SetRange Range("A5:Y28")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Can anybody help me please??
I have attached my spreadsheet also
Bookmarks