Hello tout le monde,
Voilà j'ai remis ma procédure avec la correction de Didier_mdf que je remerci au passage En résumé tout fonctionnait ( fonctionne bien ) jusqu'au début de la procédure: If TextBox16 = "" Then Exit Sub en bas de cette page. Cela va en Colonne B parce que en colonne A je dois mettre un N° automatique pour chaque enregistrement arrivant de ma procédure
Merci beaucoup @+
Ouin-Ouin
Private Sub CommandButton1_Click()
Dim WB As String, WS As String, WR As String
Dim TheNum As Double
With Sheets("Document")
.Activate
.Copy
End With
With ActiveWorkbook.ActiveSheet
.Range("B41") = ComboBox1
.Range("B42") = TextBox3
.Range("B43") = TextBox5
.Range("B46") = TextBox8
.Range("B35") = TextBox9
.Range("C35") = TextBox10
.Range("D35") = TextBox11
.Range("E35") = TextBox12
.Range("B38") = TextBox2
.Range("D23") = Label1
.Range("E23") = Label2
.Range("B55") = TextBox1
.Range("C8") = TextBox17
.Range("C9") = TextBox16
.Range("D9") = TextBox15
If Not IsNumeric(TextBox13) Then Exit Sub
TheNum = TextBox13.Value
With .Range("C23")
.Value = TheNum
.NumberFormat = "#,###,##0.000"
End With
If Not IsNumeric(Label1) Then Exit Sub
TheNum = Label1.Caption
With .Range("D23")
.Value = TheNum
.NumberFormat = "#,###,##0.000"
End With
If Not IsNumeric(Label2) Then Exit Sub
TheNum = Label2.Caption
With .Range("E23")
.Value = TheNum
.NumberFormat = "#,###,##0.000"
End With
End With
Application.Dialogs(xlDialogSaveAs).Show "Document.xls"
----------------------------------------------->>>>> depuis ici j'ai le problème et là je dois encore mettre la procédure que en Colonne A j'ai un N° automatique pour chaque enregistrement ---------------->>>>>
If TextBox16 = "" Then Exit Sub
Ligne = Sheets("AnnexeII").Range("A65536").End(xlUp).Row + 1
Sheets("AnnexeII").Range("B" & Ligne) = TextBox16
AnnexeII.Range("B" & CStr(Ligne)) = TextBox16
AnnexeII.Range("C" & CStr(Ligne)) = TextBox15
AnnexeII.Range("D" & CStr(Ligne)) = TextBox2
AnnexeII.Range("E" & CStr(Ligne)) = TextBox9
AnnexeII.Range("F" & CStr(Ligne)) = ComBox1
AnnexeII.Range("G" & CStr(Ligne)) = TextBox3
AnnexeII.Range("H" & CStr(Ligne)) = TextBox8
AnnexeII.Range("I" & CStr(Ligne)) = TextBox5
AnnexeII.Range("J" & CStr(Ligne)) = TextBox13
AnnexeII.Range("k" & CStr(Ligne)) = Label2
AnnexeII.Range("N" & CStr(Ligne)) = Label1