1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| Public Fl As Worksheet, Flcd As Worksheet, Flech As Worksheet
Public nlig As Integer, lNx As Integer, col As Integer
Public rancom As Range, randes As Integer
Public satisf As Boolean
Sub copieclient()
Set Flcd = ThisWorkbook.Worksheets("CC2012")
Set Fl = ThisWorkbook.Worksheets("facturation prévisionnelle")
Set Flech = ThisWorkbook.Worksheets("Echéancier")
Set rancom = Application.InputBox("Sélectionnez une plage !", "Sélection de cellules", Type:=8)
If Not rancom Is Nothing Then
lNx = rancom.Row
Fl.Activate
Range("A1").Select
If Range("A2").Value <> "" Then ActiveCell.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
randes = ActiveCell.Row
ActiveCell.Offset(0, 1).Value = Flcd.Cells(lNx, 8) 'Nom du client
ActiveCell.Offset(0, 2).Value = rancom.Value 'Numéro de commande
ActiveCell.Offset(0, 3).Value = Flcd.Cells(lNx, 9) ' Nom du chantier
ActiveCell.Offset(0, 5).Value = "=TODAY()" ' Nom du chantier
Flcd.Cells(lNx, 1).Copy Fl.Cells(randes, 1) ' Numéro de Devis
U_Fact.Show
If satisf = True Then
Fl.Cells(randes, 7).Value = U_Fact.TextBox1.Value 'Numéro de Bon
Fl.Cells(randes, 9).Value = U_Fact.CInt(TextBox2.Value) 'Numéro de palette
Fl.Cells(randes, 10).Value = U_Fact.CInt(TextBox3.Value) 'Nombre de pierre
Fl.Cells(randes, 8).Value = U_Fact.CByte(TextBox3.Value) 'Montant Hors taxe
Fl.Cells(randes, 11).Value = U_Fact.CByte(TextBox5.Value) 'Versement
Fl.Cells(randes, 12).Value = U_Fact.ComboBox1.Value 'Chèque ou espèce
Fl.Cells(randes, 13).Value = U_Fact.ComboBox2.Value 'statut complete /partielle
Fl.Cells(randes, 14).Value = U_Fact.ComboBox3.Value 'Vu par tel/mail/pers.
End If
If satisf = False Then
U_Fact.Hide
Flcd.Activate
End If
End If
End Sub |
Partager