Voilà toute la nouvelle procédure revue et corrigée
( surtout la formulation des IF ) Un tout grand merci à LaurentTBT pour sa précieuse collaboration matinale
With TheBaseBook.Sheets("AnnexeII") 'vu qu'on a deux classeurs à ce moment là...
Ligne = .Range("B65536").End(xlUp).Row + 1
.Cells(Ligne, 1) = Ligne - 2
If TextBox14 = 2.5 Then
.Cells(Ligne, 2) = TextBox16
.Cells(Ligne, 3) = TextBox15
.Cells(Ligne, 4) = TextBox2
.Cells(Ligne, 5) = TextBox9
.Cells(Ligne, 6) = ComboBox1
.Cells(Ligne, 7) = TextBox3
.Cells(Ligne, 8) = TextBox8
.Cells(Ligne, 9) = TextBox5
.Cells(Ligne, 12) = TextBox13
.Range("O" & CStr(Ligne)) = Label2
.Range("N" & CStr(Ligne)) = Label1
.Range("J" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("L" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("N" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("O" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
Else
If TextBox14 = "5" Or TextBox14 = "10" Then
.Cells(Ligne, 2) = TextBox16
.Cells(Ligne, 3) = TextBox15
.Cells(Ligne, 4) = TextBox2
.Cells(Ligne, 5) = TextBox9
.Cells(Ligne, 6) = ComboBox1
.Cells(Ligne, 7) = TextBox3
.Cells(Ligne, 8) = TextBox8
.Cells(Ligne, 9) = TextBox5
.Cells(Ligne, 10) = TextBox13
.Range("O" & CStr(Ligne)) = Label2
.Range("N" & CStr(Ligne)) = Label1
.Range("J" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("L" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("N" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("O" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
End If
End If
End With
'Merci Didier_mdf forum Excel pour toute son aide
With TheBaseBook.Sheets("AnnexeV") 'vu qu'on a deux classeurs à ce moment là...
Ligne = .Range("B65536").End(xlUp).Row + 1
.Cells(Ligne, 1) = Ligne - 2
If TextBox14 = 1.5 Then
If TextBox9 = "M" Then
.Cells(Ligne, 2) = TextBox16
.Cells(Ligne, 3) = TextBox15
.Cells(Ligne, 4) = TextBox2
.Cells(Ligne, 5) = TextBox9
.Cells(Ligne, 6) = ComboBox1
.Cells(Ligne, 7) = TextBox3
.Cells(Ligne, 8) = TextBox8
.Cells(Ligne, 9) = TextBox5
.Cells(Ligne, 10) = TextBox13
.Range("O" & CStr(Ligne)) = Label2
.Range("N" & CStr(Ligne)) = Label1
.Range("J" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("L" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("N" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("O" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
Else
.Cells(Ligne, 2) = TextBox16
.Cells(Ligne, 3) = TextBox15
.Cells(Ligne, 4) = TextBox2
.Cells(Ligne, 5) = TextBox9
.Cells(Ligne, 6) = ComboBox1
.Cells(Ligne, 7) = TextBox3
.Cells(Ligne, 8) = TextBox8
.Cells(Ligne, 9) = TextBox5
.Cells(Ligne, 12) = TextBox13
.Range("O" & CStr(Ligne)) = Label2
.Range("N" & CStr(Ligne)) = Label1
.Range("J" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("L" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("N" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
.Range("O" & CStr(Ligne)).NumberFormat = "#,###,###0.000"
End If
End If
End With
End Sub
'Merci LaurentTBT forum Excel pour toute son aide
@plus pour de nouvelles aventures
Bon app Ouin-Ouin