Private Sub Bout_Conf_Bail_Click()
Dim copies As Variant
If MsgBox("Etes-vous certain de vouloir remplir un bail ?", vbYesNo) = vbYes Then
If ComboBox1 = "" Or ComboBox2 = "" Then
Exit Sub
Else
With Sheets("Bail_vierge")
.Range("C4").Value = Sheets("PARAMETRES").Range("B3").Value & " " & Sheets("PARAMETRES").Range("C3").Value
.Range("C5").Value = Sheets("PARAMETRES").Range("B4").Value
.Range("C6").Value = Sheets("PARAMETRES").Range("B5").Value & " " & Sheets("PARAMETRES").Range("C5").Value & " " & Sheets("PARAMETRES").Range("B6").Value & " " & Sheets("PARAMETRES").Range("C6").Value
.Range("C8").Value = TextBox6 & " " & ComboBox2.Value & " N° nat. " & Sheets("Locataires").Cells(Nr_Lign_Loc, 7)
.Range("C9").Value = Sheets("Locataires").Cells(Nr_Lign_Loc, 3) & " " & Sheets("Locataires").Cells(Nr_Lign_Loc, 4) & _
", " & Sheets("Locataires").Cells(Nr_Lign_Loc, 5) & " " & Sheets("Locataires").Cells(Nr_Lign_Loc, 6)
.Range("C16").Value = ComboBox1.Value
.Range("C17").Value = Sheets("Biens").Cells(Nr_Lign_Bien, 4) & " " & Sheets("Biens").Cells(Nr_Lign_Bien, 5) _
& " à " & Sheets("Biens").Cells(Nr_Lign_Bien, 7) & " " & Sheets("Biens").Cells(Nr_Lign_Bien, 6)
.Range("C18").Value = Sheets("Biens").Cells(Nr_Lign_Bien, 8)
.Range("B19").Value = Sheets("Biens").Cells(Nr_Lign_Bien, 9)
.Range("C23").Value = TextBox7.Value & " et se terminant le " & TextBox8.Value
.Range("C25").Value = TextBox9.Value & "€"
.Range("C27").Value = Sheets("PARAMETRES").Range("B9").Value
.Range("G27").Value = Sheets("PARAMETRES").Range("B3").Value
.Range("C29").Value = "Mois de " & ComboBox3.Value
.Range("D31").Value = TextBox9.Value * 2 & "€"
.Range("F37").Value = TextBox14.Value & "€"
.Range("E116").Value = TextBox14.Value & "E"
End With
If MsgBox("Voulez-vous l'imprimer ?", vbYesNo) = vbYes Then
copies = InputBox("NOMBRE DE COPIES ?", "Indiquer la quantité désirée...")
On Error Resume Next
Worksheets("Bail_vierge").PrintOut copies:=copies
Else
Exit Sub
End If
End If
Else
End Sub
End If
End Sub