-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfRankScores.bas
39 lines (27 loc) · 1021 Bytes
/
fRankScores.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Attribute VB_Name = "fRankScores"
Sub RankScores()
Attribute RankScores.VB_ProcData.VB_Invoke_Func = "r\n14"
'
' RankScores Macro
'
'
Columns("A:B").Select
ActiveWorkbook.Worksheets("Ranked").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Ranked").Sort.SortFields.Add Key:=Range("B2:B1000") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Ranked").Sort
.SetRange Range("A1:B1000")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Dim ws As Worksheet
Set ws = Worksheets("Ranked")
Dim rngSht As Worksheet
Set rngSht = Worksheets("Score Matrix")
Dim lastRow As Long
lastRow = (rngSht.Range("A13").CurrentRegion.rows.Count)
ws.Range("A1:B" & lastRow).RemoveDuplicates Columns:=Array(1, 2), Header:=xlYes
End Sub