CycloneSteel
New Member
- Joined
- May 10, 2004
- Messages
- 11
I have a golf league SS that I have been using for years for a 9 hole league but I added another 18 hole league and it's giving me fits! Some guys play the front and some play the back each week, so when I sort my normal way (rounds played over .49) when I do a top 10 for each hole, or for each 9, it's returning a bunch of zeros as the top 10 best score since half the guys didn't play the front. It's returning the overall top 10 each week just fine yet.
Here's a snippet starting from the top:
Sub Top10z()
Dim LastRow As Long, Top60Row As Long, s As String, Rng As Range, CopyRng As Range, ws As Worksheet
Set ws = Worksheets("2018 Stats")
s = Application.Calculation
With Application
.EnableEvents = False
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ws
LastRow = .Cells(Rows.Count, "AT").End(xlUp).Row
Set Rng = .Range("A2:FC" & LastRow)
With Rng
.Sort Key1:=Range("AT3"), Order1:=xlDescending, Header:=xlYes
End With
Top90Row = Application.WorksheetFunction.Match(0.49, .Range("AT3:AT" & LastRow), -1) + 2
Set Rng = .Range("A2:FC" & Top90Row)
With Rng
.Sort Key1:=.Range("S3"), Order1:=xlAscending, Key2:=.Range("I3"), Order2:=xlDescending, Header:=xlYes
Set CopyRng = Union(ws.[a3:a12], ws.[i3:i12], ws.[s3:s12])
CopyRng.Copy ws.[fj2]
.Sort Key1:=.Range("T3"), Order1:=xlAscending, Key2:=.Range("I3"), Order2:=xlDescending, Header:=xlYes
Set CopyRng = Union(ws.[a3:a12], ws.[i3:i12], ws.[t3:t12])
CopyRng.Copy ws.[fp2]
.Sort Key1:=.Range("U3"), Order1:=xlAscending, Key2:=.Range("I3"), Order2:=xlDescending, Header:=xlYes
Set CopyRng = Union(ws.[a3:a12], ws.[i3:i12], ws.[u3:u12])
CopyRng.Copy ws.[fe2]
Somehow I want all the S3/T3/U3 -and many more cells -to return the top 10 non zero numbers (well, the lowest scores) -where S is the Front 9, T is the back 9 and U is the Total (they only play the front or the back each week. I am hoping to avoid having to keep a separate tab for each 9 since I want to do stats like top 10 total average and run this all on one tab, if possible! Thanks!
Here's a snippet starting from the top:
Sub Top10z()
Dim LastRow As Long, Top60Row As Long, s As String, Rng As Range, CopyRng As Range, ws As Worksheet
Set ws = Worksheets("2018 Stats")
s = Application.Calculation
With Application
.EnableEvents = False
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ws
LastRow = .Cells(Rows.Count, "AT").End(xlUp).Row
Set Rng = .Range("A2:FC" & LastRow)
With Rng
.Sort Key1:=Range("AT3"), Order1:=xlDescending, Header:=xlYes
End With
Top90Row = Application.WorksheetFunction.Match(0.49, .Range("AT3:AT" & LastRow), -1) + 2
Set Rng = .Range("A2:FC" & Top90Row)
With Rng
.Sort Key1:=.Range("S3"), Order1:=xlAscending, Key2:=.Range("I3"), Order2:=xlDescending, Header:=xlYes
Set CopyRng = Union(ws.[a3:a12], ws.[i3:i12], ws.[s3:s12])
CopyRng.Copy ws.[fj2]
.Sort Key1:=.Range("T3"), Order1:=xlAscending, Key2:=.Range("I3"), Order2:=xlDescending, Header:=xlYes
Set CopyRng = Union(ws.[a3:a12], ws.[i3:i12], ws.[t3:t12])
CopyRng.Copy ws.[fp2]
.Sort Key1:=.Range("U3"), Order1:=xlAscending, Key2:=.Range("I3"), Order2:=xlDescending, Header:=xlYes
Set CopyRng = Union(ws.[a3:a12], ws.[i3:i12], ws.[u3:u12])
CopyRng.Copy ws.[fe2]
Somehow I want all the S3/T3/U3 -and many more cells -to return the top 10 non zero numbers (well, the lowest scores) -where S is the Front 9, T is the back 9 and U is the Total (they only play the front or the back each week. I am hoping to avoid having to keep a separate tab for each 9 since I want to do stats like top 10 total average and run this all on one tab, if possible! Thanks!