VBA Code:
Dim DecRND(12) As Variant
DecRND(1) = Rnd(): DecRND(2) = Rnd(): DecRND(3) = Rnd(): DecRND(4) = Rnd()
DecRND(5) = Rnd(): DecRND(6) = Rnd(): DecRND(7) = Rnd(): DecRND(8) = Rnd()
DecRND(9) = Rnd(): DecRND(10) = Rnd(): DecRND(11) = Rnd(): DecRND(12) = Rnd()
' This line assigns 12 different random numbers to each arry element
Dim myRange As Range
Set myRange = Range("{DecRND(1),DecRND(2), DecRND(3),DecRND(4), DecRND(5),DecRND(6), DecRND(7),DecRND(8), DecRND(9),DecRND(10), DecRND(11),DecRND(12)}")
If (f9_count = 0) Then
' syntax Application.WorksheetFunction.Index(Bound, row_num, column_num)
' syntax application.worksheetfunction.rank(RankLevel, Array, Order)
f9_count = Application.WorksheetFunction.Index(Bound, Application.WorksheetFunction.Rank(DecRND(1), myRange, 0), 1)
ws2.Range("$J$6").Value = f9_count
End If
Last edited by a moderator: