Private Sub CmdValideInfoParc_Click()
For Each ctrl In Me.Controls
If TypeName(ctrl) = "TextBox" Then
If ctrl = "" Then
MsgBox "Il reste des champs vides! ", vbCritical + vbOKOnly, "Avertissement"
ctrl.SetFocus
Exit Sub
End If
End If
Next ctrl
For Each cbo In Me.Controls
If TypeName(cbo) = "ComboBox" Then
If cbo = "" Then
MsgBox "Vous devez entrer l'année! ", vbCritical + vbOKOnly, "Avertissement"
cbo.SetFocus
Exit Sub
End If
End If
Next cbo
With shtjanvier
.Range("AB1") = txtParc.Value
.Range("AB2") = txtCodeParc.Value
.Range("AB3") = txtDirection.Value
.Range("B58") = txtResponsable.Value
.Range("F8") = txtPayant1.Value
.Range("H8") = txtPayant2.Value
.Range("J8") = txtPayant3.Value
.Range("M7") = txtNpayant1.Value
.Range("O7") = txtNpayant2.Value
.Range("Q7") = txtNpayant3.Value
.Range("S7") = txtNpayant4.Value
.Range("U7") = txtNpayant5.Value
.Range("W7") = txtNpayant6.Value
.Range("Y7") = txtNpayant7.Value
.Range("F4") = CboAnnee.Value
.Range("A9") = DateSerial(CboAnnee.Value, 1, txtDate.Value)
End With
Unload Me
End Sub