Private Sub btnajout_Click()
With Sheets("Source")
fin = .Range("A" & .Rows.Count).End(xlUp).Row + 1 'on se positionne sur la dernière ligne non vide
.Cells(fin, 1) = cbonoms.Value
.Cells(fin, 2) = txtnumerodepreparation
.Cells(fin, 3) = txtdatedintervention
.Cells(fin, 4) = cbosemaine
.Cells(fin, 5) = cboannée
.Cells(fin, 6) = txtnumeroIST
.Cells(fin, 7) = cbozone4
.Cells(fin, 8) = cbozone3
.Cells(fin, 9) = cbozone2
.Cells(fin, 10) = cbotravauxàrealiser
.Cells(fin, 11) = cbolibelledestravaux
.Cells(fin, 12) = cbolibelledestravaux
.Cells(fin, 13) = cbooiotp
.Cells(fin, 14) = txtotnumero1
.Cells(fin, 15) = txtotnumero2
.Cells(fin, 16) = txtotnumero3
.Cells(fin, 17) = txtotnumero4
.Cells(fin, 18) = txtzanumero1
.Cells(fin, 19) = txtzanumero2
.Cells(fin, 20) = txtzanumero3
.Cells(fin, 21) = txtzanumero4
.Cells(fin, 22) = cboentitée
.Cells(fin, 23) = cbozoneactivitée
.Cells(fin, 24) = txtadresse
.Cells(fin, 25) = txttelephone
.Cells(fin, 26) = txtpostetechnique
.Cells(fin, 27) = txtequipement
.Cells(fin, 28) = cbomateriel
.Cells(fin, 29) = cboposterte
.Cells(fin, 30) = cbotension
.Cells(fin, 31) = cbobarre
.Cells(fin, 32) = cbosection
.Cells(fin, 33) = cbotroçon
.Cells(fin, 34) = cbodescriptiondestravaux
.Cells(fin, 35) = txtobservations
End With
MsgBox "vos données ont bien été enregistrées dans la base de données", vbOKOnly + vbInformation, "CONFIRMATION"
With Sheets("Entête")
.Range("C3") = cbonoms.Value
.Range("H3") = txtnumerodepreparation
.Range("M3") = txtdatedintervention
' = cbosemaine
' = cboannée
' = txtnumeroIST
' = cbozone4
' = cbozone3
' = cbozone2
' = cbotravauxàrealiser
' = cbolibelledestravaux
' = cbolibelledestravaux
' = cbooiotp
' = txtotnumero1
' = txtotnumero2
' = txtotnumero3
' = txtotnumero4
' = txtzanumero1
' = txtzanumero2
' = txtzanumero3
' = txtzanumero4
' = cboentitée
' = cbozoneactivitée
' = txtadresse
' = txttelephone
' = txtpostetechnique
' = txtequipement
' = cbomateriel
' = cboposterte
' = cbotension
' = cbobarre
' = cbosection
' = cbotroçon
' = cbodescriptiondestravaux
' = txtobservations
End With
End Sub