Dim tabl Dim laplage As Range Set laplage = Range("A1:A3") tabl = laplage MsgBox UBound(tabl, 1) & " ligne(s) et " & UBound(tabl, 2) & " colonne(s)"
Public Function Matrice(mafeuille as worksheet) As Range Set Matrice = MaFeuille.Range(maFeuille.Cells(1, 1), MaFeuille.Cells(5, 5)) End Function
set mavariable = worksheets(2).maplage
Private Sub CommandButton1_Click() Dim tabl Dim laplage As Range Set laplage = Range("A1:A3") tabl = matrice(laplage) MsgBox UBound(tabl, 1) & " ligne(s) et " & UBound(tabl, 2) & " colonne(s)" End Sub Private Function matrice(maplage As Range) matrice = maplage End Function
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPublic Matrice() As Range Set Matrice = MaFeuille.Range(maFeuille.Cells(1, 1), MaFeuille.Cells(5, 5))
For i = 1 To UBound(Matrice_Augeo, 1) For j = 1 To UBound(Matrice_Augeo, 2) Set Matrice_Augeo(i, j) = MaPlage.Cells(i, j) Next Next