Je doit commenter le code d'un fichier VB pour un cour, et je n'arrive pas à décrire l'utilité de chaque ligne de code.
Pourriez vous m'apporter votre aide ??
Il faudrait décrire les lignes à l'aide de commentaire si possible.
je joint le code à la fin du message en espérant que l'un de vous pourra m'accorder de son temps pour décrypter le code.
En vous remerciant par avance
Samuel Villeneuve
------------------------------------------------------------------------
Private Sub CommandButton2_Click()
Unload CHRONO
End Sub
Private Sub UserForm_Initialize()
datej = Date
With Sheets("Feuil2").Range("A1")
Me.rp.RowSource = Range(.Cells, .End(xlDown)(1, 2)).Address(External:=True)
End With
With Sheets("Feuil2").Range("B1")
Me.ass.RowSource = Range(.Cells, .End(xlDown)(1, 2)).Address(External:=True)
End With
With Sheets("Feuil2").Range("C1")
Me.dom.RowSource = Range(.Cells, .End(xlDown)(1, 2)).Address(External:=True)
End With
With Sheets("Feuil2").Range("D1")
Me.TYPEF.RowSource = Range(.Cells, .End(xlDown)(1, 2)).Address(External:=True)
End With
With Sheets("Feuil2").Range("E1")
Me.REF.RowSource = Range(.Cells, .End(xlDown)(1, 2)).Address(External:=True)
End With
End Sub
Private Sub CommandButton1_Click()
If rp.Value = "" Then
MsgBox ("Vous devez choisir un suiveur d'affaires")
rp.SetFocus
Exit Sub
End If
If ass.Value = "" Then
MsgBox ("Vous devez choisir une assistante")
ass.SetFocus
Exit Sub
End If
If dom.Value = "" Then
MsgBox ("Vous devez choisir un client")
dom.SetFocus
Exit Sub
End If
If Intit.Value = "" Then
MsgBox ("Vous devez saisir la remarque")
Intit.SetFocus
Exit Sub
End If
If client.Value = "" Then
MsgBox ("Vous devez saisir la nouveauté ")
client.SetFocus
Exit Sub
End If
If TYPEF.Value = "" Then
MsgBox ("Vous devez choisir un commercial ")
TYPEF.SetFocus
Exit Sub
End If
If REF.Value = "" Then
MsgBox ("Vous devez choisir un commercial ")
REF.SetFocus
Exit Sub
End If
CHRONO.Hide
reponse = MsgBox("Le numéro chrono de cette information est " & Month(datej) & "-" & Year(datej) & "-" & num & Chr(10) & " " & "L'action est bien enregistrée dans le classeur chrono, la relance peut se faire le " & CDate(datej) + 15, vbYes, "Attribution numéro chrono")
End Sub