bonsoir Jojo
j'espere que les explications ci dessous repondront à ta demande
par exemple pour les declarations de variable
dim X as Byte , Y as Byte
Dim tableau() As String
ensuite pour dimensionner le tableau le principe est
X=10
Y=20
ReDim tableau(X,Y)
si tu souhaites redimensionner un tableau en conservant des valeurs deja existantes dans ce tableau tu peux ecrire
ReDim Preserve tableau(X,Y)
ci joint un exemple qui compte les noms identiques dans la colonne A , sinon tu peux aussi utliser l'aide excel pour avoir d'autres informations
Sub CompterLesNomsIdentiques()
'http://www.excel-downloads.com/html/French/forum/messages/1_59789_59762.htm
'michel
'le 05 12 2003
Dim Cell As Range
Dim Ligne As Integer, i As Integer
Dim M As Byte
Dim U as Boolean
Dim Tableau() As String
Dim Resultat As String
Ligne = Range("A65536").End(xlUp).Row
M = 1
ReDim Preserve Tableau(2, M)
For Each Cell In Range("A1:A" & Ligne)
U = False
For i = 1 To M
If Cell = Tableau(0, i - 1) Then
Tableau(1, i - 1) = Tableau(1, i - 1) + 1
U = True
Exit For
End If
Next i
If Tableau(1, M - 1) = "" And U = False Then
Tableau(0, M - 1) = Cell
Tableau(1, M - 1) = 1
M = M + 1
ReDim Preserve Tableau(2, M)
End If
Next Cell
For i = 1 To M - 1
Resultat = Resultat & Tableau(0, i - 1) & Chr(9) & Tableau(1, i - 1) & Chr(10)
Next i
MsgBox Resultat
End Sub
bonne soirée
michel