Re : Regarde et ajout, sinon passe au suivant
Bonjour,
J'ai fait le code et visblement j'ai un soucis quelque part, pouvez vous m'aider
merci d'avance
Private Sub CommandButton4_Click()
ligne = Sheets("Compta").[A65000].End(xlUp).Row + 1
On Error Resume Next
With Sheets("Compta")
'Ecriture ligne 1
.Cells(ligne, 1) = CDbl(Me.col1)
.Cells(ligne, 2) = Format(CDbl(DTPicker1), "ddmmyy")
.Cells(ligne, 3) = CDbl(Me.Label64)
.Cells(ligne, 4) = CDbl(411000)
.Cells(ligne, 5) = Format(Date, "yyyyddmm") & "_" & Format(Me.N°3, "000") & " " & Me.choixclient
.Cells(ligne, 6) = Me.TextBox4
.Cells(ligne, 7) = CDbl(Me.TTC)
.Cells(ligne, 11) = "G"
ligne = Sheets("Compta").[A65000].End(xlUp).Row + 1
'Ecriture ligne tva
.Cells(ligne, 1) = CDbl(Me.col1)
.Cells(ligne, 2) = Format(CDbl(DTPicker1), "ddmmyy")
.Cells(ligne, 4) = CDbl(Me.Label63)
.Cells(ligne, 5) = Format(Date, "yyyyddmm") & "_" & Format(Me.N°3, "000") & " " & Me.choixclient
.Cells(ligne, 6) = Me.TextBox4
.Cells(ligne, 8) = CDbl(Me.TVA)
.Cells(ligne, 11) = "G"
ligne = Sheets("Compta").[A65000].End(xlUp).Row + 1
'Ecriture ligne art 1
.Cells(ligne, 1) = CDbl(Me.col1)
.Cells(ligne, 2) = Format(CDbl(DTPicker1), "ddmmyy")
.Cells(ligne, 4) = CDbl(Me.Label55)
.Cells(ligne, 5) = Format(Date, "yyyyddmm") & "_" & Format(Me.N°3, "000") & " " & Me.choixclient
.Cells(ligne, 6) = Me.TextBox4
.Cells(ligne, 8) = CDbl(Me.montant1)
.Cells(ligne, 11) = "G "
'Ecriture ligne art 2
ligne = Sheets("Compta").[A65000].End(xlUp).Row + 1
.Cells(ligne, 1) = CDbl(Me.col1)
.Cells(ligne, 2) = Format(CDbl(DTPicker1), "ddmmyy")
.Cells(ligne, 4) = CDbl(Me.Label56)
.Cells(ligne, 5) = Format(Date, "yyyyddmm") & "_" & Format(Me.N°3, "000") & " " & Me.choixclient
.Cells(ligne, 6) = Me.TextBox4
.Cells(ligne, 8) = CDbl(Me.montant2)
.Cells(ligne, 11) = "G "
'Ecriture ligne art 3
ligne = Sheets("Compta").[A65000].End(xlUp).Row + 1
.Cells(ligne, 1) = CDbl(Me.col1)
.Cells(ligne, 2) = Format(CDbl(DTPicker1), "ddmmyy")
.Cells(ligne, 4) = CDbl(Me.Label57)
.Cells(ligne, 5) = Format(Date, "yyyyddmm") & "_" & Format(Me.N°3, "000") & " " & Me.choixclient
.Cells(ligne, 6) = Me.TextBox4
.Cells(ligne, 8) = CDbl(Me.montant3)
.Cells(ligne, 11) = "G"
'Ecriture ligne art 4
ligne = Sheets("Compta").[A65000].End(xlUp).Row + 1
.Cells(ligne, 1) = CDbl(Me.col1)
.Cells(ligne, 2) = Format(CDbl(DTPicker1), "ddmmyy")
.Cells(ligne, 4) = CDbl(Me.Label58)
.Cells(ligne, 5) = Format(Date, "yyyyddmm") & "_" & Format(Me.N°3, "000") & " " & Me.choixclient
.Cells(ligne, 6) = Me.TextBox4
.Cells(ligne, 8) = CDbl(Me.montant4)
.Cells(ligne, 11) = "G"
'Ecriture ligne art 5
ligne = Sheets("Compta").[A65000].End(xlUp).Row + 1
.Cells(ligne, 1) = CDbl(Me.col1)
.Cells(ligne, 2) = Format(CDbl(DTPicker1), "ddmmyy")
.Cells(ligne, 4) = CDbl(Me.Label59)
.Cells(ligne, 5) = Format(Date, "yyyyddmm") & "_" & Format(Me.N°3, "000") & " " & Me.choixclient
.Cells(ligne, 6) = Me.TextBox4
.Cells(ligne, 8) = CDbl(Me.montant5)
.Cells(ligne, 11) = "G"
'Ecriture ligne art 6
ligne = Sheets("Compta").[A65000].End(xlUp).Row + 1
.Cells(ligne, 1) = CDbl(Me.col1)
.Cells(ligne, 2) = Format(CDbl(DTPicker1), "ddmmyy")
.Cells(ligne, 4) = CDbl(Me.Label60)
.Cells(ligne, 5) = Format(Date, "yyyyddmm") & "_" & Format(Me.N°3, "000") & " " & Me.choixclient
.Cells(ligne, 6) = Me.TextBox4
.Cells(ligne, 8) = CDbl(Me.montant6)
.Cells(ligne, 11) = "G"
'Ecriture ligne art 7
ligne = Sheets("Compta").[A65000].End(xlUp).Row + 1
.Cells(ligne, 1) = CDbl(Me.col1)
.Cells(ligne, 2) = Format(CDbl(DTPicker1), "ddmmyy")
.Cells(ligne, 4) = CDbl(Me.Label61)
.Cells(ligne, 5) = Format(Date, "yyyyddmm") & "_" & Format(Me.N°3, "000") & " " & Me.choixclient
.Cells(ligne, 6) = Me.TextBox4
.Cells(ligne, 8) = CDbl(Me.montant7)
.Cells(ligne, 11) = "G "
'Ecriture ligne art 8
ligne = Sheets("Compta").[A65000].End(xlUp).Row + 1
.Cells(ligne, 1) = CDbl(Me.col1)
.Cells(ligne, 2) = Format(CDbl(DTPicker1), "ddmmyy")
.Cells(ligne, 4) = CDbl(Me.Label62)
.Cells(ligne, 5) = Format(Date, "yyyyddmm") & "_" & Format(Me.N°3, "000") & " " & Me.choixclient
.Cells(ligne, 6) = Me.TextBox4
.Cells(ligne, 8) = CDbl(Me.montant8)
.Cells(ligne, 11) = "G "
End With
End Sub
Manu