The vba codes (TeeDrawPlayers) below returns 4 columns of data and the second one (TeeDrawCarts) I want it to return 2 columns of data how can I update the second one to do this
Cheers
NZAS
Sub TeeDrawPlayers()
Range("A3:D40").ClearContents
lo = Range("A2") ' low
hi = Range("B2") 'high
rg = hi - lo
r = 3
c = 1
For p = lo To hi
10 x = WorksheetFunction.RandBetween(lo, hi)
If WorksheetFunction.CountIf(Range("A3:D40"), x) >= 1 Then GoTo 10 'find another number
Cells(r, c) = x
c = c + 1
If c = 5 Then
r = r + 1
c = 1
End If
Next p
End Sub
Sub TeeDrawCarts()
Range("A46:D60").ClearContents
lo = Range("A45") ' low
hi = Range("B45") 'high
rg = hi - lo
r = 46
c = 1
For p = lo To hi
10 x = WorksheetFunction.RandBetween(lo, hi)
If WorksheetFunction.CountIf(Range("A46:B60"), x) >= 1 Then GoTo 10 'find another number
Cells(r, c) = x
c = c + 1
If c = 3 Then
r = r + 1
c = 1
End If
Next p
End Sub
Cheers
NZAS
Sub TeeDrawPlayers()
Range("A3:D40").ClearContents
lo = Range("A2") ' low
hi = Range("B2") 'high
rg = hi - lo
r = 3
c = 1
For p = lo To hi
10 x = WorksheetFunction.RandBetween(lo, hi)
If WorksheetFunction.CountIf(Range("A3:D40"), x) >= 1 Then GoTo 10 'find another number
Cells(r, c) = x
c = c + 1
If c = 5 Then
r = r + 1
c = 1
End If
Next p
End Sub
Sub TeeDrawCarts()
Range("A46:D60").ClearContents
lo = Range("A45") ' low
hi = Range("B45") 'high
rg = hi - lo
r = 46
c = 1
For p = lo To hi
10 x = WorksheetFunction.RandBetween(lo, hi)
If WorksheetFunction.CountIf(Range("A46:B60"), x) >= 1 Then GoTo 10 'find another number
Cells(r, c) = x
c = c + 1
If c = 3 Then
r = r + 1
c = 1
End If
Next p
End Sub