G
Gilbo
I have used a macro to gererate fixtures for a league but it doesn't
calculate properly. All teams should play each other once, (ie 10 teams - 90
matches). I have used the following macro. Thanks for your help in advance.
Sub leagueMatch()
Dim i, j As Long
Dim datacolumn As String
Dim resultColumn As String
Dim firstRow, lastRow, currRow As Long
datacolumn = "A"
resultColumn = "C"
firstRow = 1
currRow = 1
lastRow = Range(datacolumn & Rows.Count).End(xlUp).Row
For i = firstRow To lastRow - 1
For j = i + 1 To lastRow
Range(resultColumn & Format(currRow)) = Range(datacolumn &
Format(i)) & " vs " & Range(datacolumn & Format(j))
currRow = currRow + 1
Next
Next
End Sub
calculate properly. All teams should play each other once, (ie 10 teams - 90
matches). I have used the following macro. Thanks for your help in advance.
Sub leagueMatch()
Dim i, j As Long
Dim datacolumn As String
Dim resultColumn As String
Dim firstRow, lastRow, currRow As Long
datacolumn = "A"
resultColumn = "C"
firstRow = 1
currRow = 1
lastRow = Range(datacolumn & Rows.Count).End(xlUp).Row
For i = firstRow To lastRow - 1
For j = i + 1 To lastRow
Range(resultColumn & Format(currRow)) = Range(datacolumn &
Format(i)) & " vs " & Range(datacolumn & Format(j))
currRow = currRow + 1
Next
Next
End Sub