ok alors si je pousse un peu le truc,
imaginons que ma variable val dépendent de la valeur d'une cellule ou autre
pourquoi ceci ne fonctionne pas?
Sub Serie_un()
Dim un, deux, trois, quatre As Integer
un = 1
deux = 2
trois = 3
quatre = 4
Msg_un "hello word", un
Msg_un "salut à tous", deux
Msg_un "holla chicas", trois
Msg_un "salut chtio biloutte", quatre
End Sub
Sub Msg_un(texte As String, val As Integer)
MsgBox texte & " - " & val
End Sub
par contre, ceci fonctionne :
Sub Serie_deux()
Dim un, deux, trois, quatre As Integer
un = 1
deux = 2
trois = 3
quatre = 4
Msg_deux (un)
Msg_deux (deux)
Msg_deux (trois)
Msg_deux (quatre)
End Sub
Sub Msg_deux(val As Integer)
MsgBox (val)
End Sub
en revanche, ceci ne focntionne plus
Sub Serie_trois()
Dim un, deux, trois, quatre As Integer
un = 1
deux = 2
trois = 3
quatre = 4
'j'ai juste retiré les parenthèses
Msg_deux un
Msg_deux deux
Msg_deux trois
Msg_deux quatre
End Sub
Sub Msg_trois(val As Integer)
MsgBox (val)
End Sub