Private Sub btnEnrPDF_Click()
Dim nomF As String
nomF = "C:\Factures\F" & Format([E4], "yyyy-mm-dd") & "_" & [E5] & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=nomF, IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
Private Sub CommandButton1_Click()
Range("v2:CT2").Select
Selection.Copy
Sheets("Archives").Select
ligne = ActiveSheet.Cells(1, 1) + 1
ActiveSheet.Cells(ligne, 6).Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Selection.Columns.AutoFit
ActiveSheet.Cells(ligne, 1) = ActiveSheet.Cells(1, 3)
numero = ActiveSheet.Cells(1, 3)
ActiveSheet.Cells(1, 3) = ActiveSheet.Cells(1, 3) + 1
ActiveSheet.Columns("C:Ch").Select
Selection.ColumnWidth = 15
Call Sommaire
ActiveSheet.Cells(2, 2).Select
Sheets("Facture simple").Select
Cells(5, 2).Select
Cells(5, 5) = numero
End Sub
Private Sub CommandButton2_Click()
Range("B1:F48").Select
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = "$B$1:$M$48"
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.511811023622047)
.RightMargin = Application.InchesToPoints(0.511811023622047)
.TopMargin = Application.InchesToPoints(0.511811023622047)
.BottomMargin = Application.InchesToPoints(0.511811023622047)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 75
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = False
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
ActiveSheet.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
' ou
' Selection.PrintOut Copies:=1, Collate:=True
Range("A29").Select
End Sub
Private Sub CommandButton3_Click()
Range("B18:E34").Select
Range("B18").Activate
Application.CutCopyMode = False
Selection.ClearContents
Cells(10, 2).Select
End Sub