1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Sub ParamètreEnvoyer()
Collection_Remplir "Et alors ? ", "C'est ", "quoi ", "ton problème ?", 5
End Sub
Sub Collection_Remplir(Paramètre1, paramètre2, paramètre3, Paramètre4, paramètre5)
Dim MaColect As New Collection
' Rempli la collection
MaColect.Add Paramètre1, "Un"
MaColect.Add paramètre2, "Deux"
MaColect.Add paramètre3, "trois"
MaColect.Add Paramètre4, "Quatre"
MaColect.Add paramètre5, "Cinq"
'Affichage
Debug.Print MaColect("Un") & MaColect("Deux") & MaColect("trois") & MaColect("Quatre")
MsgBox MaColect("Un") & MaColect("Deux") & MaColect("trois") & MaColect("Quatre") & " " & MaColect("Cinq")
'ou
MsgBox MaColect(1) & MaColect(2) & MaColect(3) & MaColect(4) & " " & MaColect(5)
End Sub |
Partager