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
| Private Sub ButtonFacture_Click()
Const Template = "Facture export CEE.xlsx"
Dim FacFile As String
Dim WbFac As String
Dim LigneCde As Long
Dim CdesPath As String
Dim TemplatesPath As String
Dim FacturesPath As String
Dim WbCdes As String
Dim i As Integer
Dim j As Integer
CdesPath = Workbooks(ActiveWorkbook.Name).Path
TemplatesPath = CdesPath & "\Templates\"
FacturesPath = CdesPath & "\Factures\"
WbCdes = Workbooks(ActiveWorkbook.Name).Name
Workbooks.Open Filename:=TemplatesPath & Template
WbFac = ActiveWorkbook.Name
Sheets("Feuil1").Select
Sheets("Feuil1").Name = "Facture"
FacFile = "Fac_" & NumCde & ".xlsx"
Workbooks(WbCdes).Activate
Workbooks(WbFac).Sheets("Facture").Cells(18, 5) = data1
Worbooks(WbFac).Sheets("Facture").Cells(19, 5) = data2
etc...
End Sub |
Partager