我对可能的结果有疑问。
每周有9场比赛,每场比赛有3种可能的结果:
是否有一个宏可以为我提供所有游戏的所有可能的结果组合。
答案 0 :(得分:0)
希望这有帮助
Dim i, j, rowloc, teams As Integer
Dim result(2) As String
result(0) = "H"
result(1) = "A"
result(2) = "D"
teams = 9
For i = 0 To 2
For j = 1 To teams
rowloc = i * teams + j
Worksheets("Sheet1").Cells(rowloc, 1).Value = "Team " & j
Worksheets("Sheet1").Cells(rowloc, 2).Value = result(i)
Worksheets("Sheet1").Cells(rowloc, 3).Value = "Team " & j + teams
Next
Next