Bonjour François, voici un copié collé de mon code, peux tu me dire ce que je dois modifier, je pourrais voir pourquoi ça bug par moments. Merci beaucoup !
EDIT : La ligne TEST 6 ne s’additionne pas au total.
Sub PDF() ' PDF Macro ENREGISTRER EN PDF
Dim fichier As String
With Sheets("FACTURES")
fichier = "C:\Users\odyssee\Documents\" & .Range("G9").Value & "_" & Format(.Range("I3").Value, "dd_mm_yyyy") & ".pdf"
End With
ChDir "C:\Users\odyssee\Documents"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
fichier, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
End Sub
Sub IMPRIMER() ' L'IMPRESSION SE LANCE AUTOMATIQUEMENT
Dim nbpages As Long, i As Integer
Application.ScreenUpdating = False
ActiveSheet.PageSetup.PrintArea = "$B$2:$J$73"
i = 50
Do While True
nbpages = ExecuteExcel4Macro("GET.DOCUMENT(50)")
If i = 16 Then Exit Do
If Range("B" & i) = "" Then
Rows(i).EntireRow.Hidden = True
Else
Rows(i).EntireRow.Hidden = False
End If
i = i - 1
If nbpages = 1 Then Exit Do
Loop
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
End Sub
Sub new_fact()
Sheets("FACTURES").Select
Rows("16:53").RowHeight = 18.75
Range("O6").Select
Range("b16:i53").ClearContents
Range("b16:i53").EntireRow.Hidden = False
Range("G8:J13").ClearContents
Range("J56:J57").ClearContents
UserForm1.Show
End Sub