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
| Sub Valider_Click()
ActiveSheet.Unprotect
Range("I12").Select
ActiveCell.FormulaR1C1 = "=TODAY()"
ActiveCell.Value = ActiveCell.Value
Range("date").Select
ActiveCell.Value = ActiveCell.Value
Dim Chemin As String, Ctr As Integer, Plage As Range, c As Range
Chemin = "C:\CONCEPT Habitat\devis1P\"
Ctr = 21
Workbooks.Open Chemin & Fich & ".xls"
Feuille = ActiveSheet.Name
With Workbooks("CONCEPT Habitat.xls").Sheets("Devis1page")
.Range("num_client") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("num_client")
.Range("fnomcli1") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("dnomcli1")
.Range("numdevis1") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("numdevis1")
.Range("frue1") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("frue1")
.Range("frue2") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("frue2")
.Range("fville") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("fville")
.Range("fcp") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("fcp")
.Range("téléphone") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("téléphone")
.Range("portable") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("portable")
.Range("dremise") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("dremise")
.Range("B17") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("B17")
.Range("H4") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("H4")
.Range("H5") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("H5")
.Range("I51") = Workbooks(Fich & ".xls").Sheets(Feuille).Range("I51")
Set Plage = Workbooks(Fich & ".xls").Sheets(Feuille).Range("A21:A50")
For Each c In Plage
.Range("A" & Ctr) = c.Value
.Range("F" & Ctr) = c.Offset(0, 1)
.Range("G" & Ctr) = c.Offset(0, 2)
.Range("H" & Ctr) = c.Offset(0, 3)
.Range("J" & Ctr) = c.Offset(0, 5)
Ctr = Ctr + 1
Next c
Workbooks(Fich & ".xls").Close False
ActiveSheet.Protect
End With
End Sub |
Partager