Public Function AddArray(ByRef TheArray() As Long, min As Long, max As Long) As Boolean
Dim i As Long
Dim x As Long
x = 0
For i = 0 To UBound(TheArray)
If x = i Then TheArray(i) = TheArray(i) + 1
If TheArray(i) > max Then x = i + 1: TheArray(i) = min Else x = -1
Next
If x <> -1 Then AddArray = True Else AddArray = False
End Function