Private Sub SetIntegerArrayValues(IArray() As Integer, ParamArray Value())
Dim IsEmpty As Boolean
IsEmpty = ((Not (Not IArray)) = 0)
If IsEmpty Then ReDim IArray(UBound(Value))
Dim i As Integer, j As Integer
For i = 0 To UBound(Value)
j = LBound(IArray) + i
If j > UBound(IArray) Then Exit For
IArray(j) = Value(i)
Next i
End Sub
'Exemples d'utilisations :
Dim Tab1() As Integer
Call SetIntegerArrayValues(Tab1, 0, 1, 2, 3, 4, 5)
Dim Tab2(3 To 6) As Integer
Call SetIntegerArrayValues(Tab2, 0, 1, 2, 3)
Dim Tab3(-4 To 2) As Integer
Call SetIntegerArrayValues(Tab3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)