George Philp
New Member
- Joined
- Nov 28, 2013
- Messages
- 5
Dear Forum, I'm hoping there's a simple answer to this question. I have created a workbook with multiple sheets to record individual people’s scores in multiple rounds of golf. I can get each sheet to determine the lowest score each player has had on each hole, and subsequently create an eclectic score row which is the lowest score achieved for each hole. I can then automatically transfer each of these to sheet 1 which I have named as “league table”. Now by adding new rounds for each person, the eclectic score can update. Having done that, when I come back to the league table sheet, the new scores are there, and of course I can sort the data manually, but is there any way I can get a macro to automate this so merely by opening that sheet up it sorts it on the fly without user intervention? I have recorded the below, but it stills needs me to activate it. Can it be totally automated? Thank you in anticipation.
Sub Macro1()
'
' Macro1 Macro
' Auto sort the League Table
'
'
Range("A1:F13").Select
ActiveWorkbook.Worksheets("League Table").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("League Table").Sort.SortFields.Add Key:=Range( _
"F2:F13"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("League Table").Sort
.SetRange Range("A1:F13")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Sub Macro1()
'
' Macro1 Macro
' Auto sort the League Table
'
'
Range("A1:F13").Select
ActiveWorkbook.Worksheets("League Table").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("League Table").Sort.SortFields.Add Key:=Range( _
"F2:F13"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("League Table").Sort
.SetRange Range("A1:F13")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub