1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
Function redimetpreserve(ligne, colonne) As Boolean
Dim boucle1 As Long, boucle2 As Long
Dim a As Variant
Dim b() As Variant
ReDim a(1 To ligne, 1 To colonne)
For boucle1 = 1 To ligne
For boucle2 = 1 To colonne
a(boucle1, boucle2) = ((boucle1 - 1) * colonne) + boucle2
Next boucle2
Next boucle1
For boucle1 = 1 To ligne
For boucle2 = 1 To colonne
Debug.Print (a(boucle1, boucle2))
Next boucle2
Next boucle1
ReDim b(ligne * 2, colonne * 2)
For boucle1 = 1 To ligne
For boucle2 = 1 To colonne
b(boucle1, boucle2) = (a(boucle1, boucle2))
Next boucle2
Next boucle1
a = b
For boucle1 = 1 To ligne
For boucle2 = 1 To colonne
Debug.Print (a(boucle1, boucle2))
Next boucle2
Next boucle1
End Function |
Partager