Autosort sheet 1 on basis of other sheets within workbook

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
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Right click the sheet tab and change the first drop down box ( top right hand side), from 'General' to 'Worksheet', then the adjacent box to 'activate'

copy and paste your macro (without the sub or end sub part)

Everytime you select the sheet, your macro will run automatically
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top