1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Private Sub boxmois_Change()
Dim nom, mois As Integer
Feuil2.Cells(15, 2) = boxmois.Text
nom = Feuil2.Cells(16, 3).Value
mois = Feuil2.Cells(15, 3).Value
Text1.ControlSource = "Feuil1!C" & CStr((nom - 1) * 12 + 1 + mois)
Text2.ControlSource = "Feuil1!D" & CStr((nom - 1) * 12 + 1 + mois)
End Sub
Private Sub boxnom_Change()
Dim nom, mois As Integer
Feuil2.Cells(16, 2) = boxnom.Text
nom = Feuil2.Cells(16, 3).Value
mois = Feuil2.Cells(15, 3).Value
Text1.ControlSource = "Feuil1!C" & CStr((nom - 1) * 12 + 1 + mois)
Text2.ControlSource = "Feuil1!D" & CStr((nom - 1) * 12 + 1 + mois)
End Sub
Private Sub CommandButton1_Click()
Unload formulaire
End Sub
Private Sub UserForm_Initialize()
boxnom.ListIndex = 0
boxmois.ListIndex = 0
End Sub |
Partager