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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
| Sub A_infosdevis()
'Dim Montant_DevisHT As Single
'Dim Montant_DevisTTC As Single
'Dim Indice_Devis As String, Cub1 As Single, Cub2 As Single, Cub3 As Single
'Dim Cub4 As Single, Cub5 As Single, Poidspart1 As Single, Poidspart2 As Single
'Dim Poidspart3 As Single, Poidspart4 As Single
'Dim Poidspart5 As Single, PoidsTotal As Single
'Dim NbrePal As Single
'Dim TVA1 As String, TVA2 As String
Dim lhts As Integer
Dim Rhts As Range
Dim Plagex As Range
Dim MDevisHT As Single
Dim MDevisTTC As Single
Dim a As Range
Dim la As Integer
Const xcolht = 13
ThisWorkbook.Worksheets("Devis").Activate
Set Plagex = Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
For Each Rhts In Plagex
If Rhts.Value = "Totalht" Then
lhts = Rhts.Row
End If
Next
MDevisHT = Worksheets("Devis").Cells(lhts, xcolht).Value
MDevisTTC = Worksheets("Devis").Cells((lhts + 2), xcolht).Value
Num_Fact = Range("F19").Value
Date_Fact = Range("L5").Value
Nom_client = Range("J13").Value
Montant_DevisHT = MDevisHT 'Erreur de compilation variable non définie
Montant_DevisTTC = MDevisTTC
Indice_Devis = Range("G19").Value
Nom_Chantier = Range("H21").Value
Nb_Pierre = Range("F21").Value
Cub1 = Range("P23").Value
Cub2 = Range("P24").Value
Cub3 = Range("P25").Value
Cub4 = Range("P26").Value
Cub5 = Range("P27").Value
Poidspart1 = Range("Q23").Value
Poidspart2 = Range("Q24").Value
Poidspart3 = Range("Q25").Value
Poidspart4 = Range("Q26").Value
Poidspart5 = Range("Q27").Value
PoidsTotal = Range("R23").Value
NbrePal = Range("O20").Value
TVA1 = Range("S23").Value
TVA2 = Range("T23").Value
Application.Workbooks.Open "Z:\Gestion entreprise\VBA\Atest\CC2011T.xlsx"
Sheets("Pilote").Activate
Range("A3").Select
If Range("A4").Value <> "" Then ActiveCell.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = Num_Fact
ActiveCell.Offset(0, 1).Value = Date_Fact
ActiveCell.Offset(0, 2).Value = Indice_Devis
ActiveCell.Offset(0, 7).Value = Nom_client
ActiveCell.Offset(0, 8).Value = Nom_Chantier
ActiveCell.Offset(0, 9).Value = Montant_DevisHT
ActiveCell.Offset(0, 14).Value = Nb_Pierre
ActiveCell.Offset(0, 17).Value = Cub1
ActiveCell.Offset(0, 18).Value = Cub2
ActiveCell.Offset(0, 19).Value = Cub3
ActiveCell.Offset(0, 20).Value = Cub4
ActiveCell.Offset(0, 21).Value = Cub5
ActiveCell.Offset(0, 35).Value = Poidspart1
ActiveCell.Offset(0, 36).Value = Poidspart2
ActiveCell.Offset(0, 37).Value = Poidspart3
ActiveCell.Offset(0, 38).Value = Poidspart4
ActiveCell.Offset(0, 39).Value = Poidspart5
ActiveCell.Offset(0, 40).Value = PoidsTotal
ActiveCell.Offset(0, 41).Value = NbrePal
ActiveCell.Offset(0, 42).Value = TVA1
ActiveCell.Offset(0, 43).Value = TVA2
Call Hyperlink
Sheets("Pilote1").Activate
Range("A3").Select
If Range("A4").Value <> "" Then ActiveCell.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = Num_Fact
ActiveCell.Offset(0, 1).Value = Date_Fact
ActiveCell.Offset(0, 2).Value = Indice_Devis
ActiveCell.Offset(0, 7).Value = Nom_client
ActiveCell.Offset(0, 8).Value = Nom_Chantier
ActiveCell.Offset(0, 9).Value = Montant_DevisHT
ActiveCell.Offset(0, 14).Value = Nb_Pierre
ActiveCell.Offset(0, 17).Value = Cub1
ActiveCell.Offset(0, 18).Value = Cub2
ActiveCell.Offset(0, 19).Value = Cub3
ActiveCell.Offset(0, 20).Value = Cub4
ActiveCell.Offset(0, 21).Value = Cub5
ActiveCell.Offset(0, 35).Value = Poidspart1
ActiveCell.Offset(0, 36).Value = Poidspart2
ActiveCell.Offset(0, 37).Value = Poidspart3
ActiveCell.Offset(0, 38).Value = Poidspart4
ActiveCell.Offset(0, 39).Value = Poidspart5
ActiveCell.Offset(0, 40).Value = PoidsTotal
ActiveCell.Offset(0, 41).Value = NbrePal
ActiveCell.Offset(0, 42).Value = TVA1
ActiveCell.Offset(0, 43).Value = TVA2
Call Hyperlink1
Set wbs = Workbooks("CC2011T.xlsx")
wbs.Activate
wbs.Saved = False
Application.DisplayAlerts = True
wbs.Close
End Sub |
Partager