1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Sub TestMachin()
Dim machin() 'une matrice
ReDim machin(1, 3) ' à deux dimensions
machin(0, 0) = "Tutu"
machin(0, 1) = "Toto"
machin(1, 1) = "tata"
machin(1, 3) = "Test"
' copie de la matrice dans une plage
Range(Cells(1, 1), Cells(UBound(machin, 1) + 1, UBound(machin, 2) + 1)) = machin
' nomme la plage
ActiveSheet.Names.Add "LaZone", _
"=" & Split(Range(Cells(1, 1), _
Cells(UBound(machin, 1) + 1, _
UBound(machin, 2) + 1)).Address(True, True, xlA1, True), _
"]")(1)
End Sub |
Partager