Re : Soucis dans l'impression
Bonjour a tous,
Bon j'arrive a faire fonctionner le tout comme ceci:
' DEMANDE D'IMPRESSION
Imprime:
Msg = "Voulez vous imprimer ?"
Style = vbYesNo + vbQuestion
Title = "IMPRESSION"
Reponse = MsgBox(Msg, Style, Title)
If Reponse = vbNo Then GoTo Fin
If Reponse = vbYes Then GoTo QQQ
'End If
QQQ:
If Range("B60").Value = "" Then
GoTo AAA
Else
GoTo BBB
End If
' MISE EN PAGE
' ENTETE ET PIED DE PAGE
AAA:
ActiveWindow.WindowState = xlMaximized
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
ActiveSheet.PageSetup.PrintArea = "A1:J54" ' Délimitation de la plage d'impression
.LeftHeader = "&""Arial,Gras""BET NEAU" ' Entete haut gauche
.CenterHeader = "&""Arial,Gras""Nomenclature" ' Entete haut centre
.RightHeader = "&""Arial,Gras""&F" ' Entete haut droite
.LeftFooter = "&""Arial,Gras""&D" ' Bas de page gauche
.RightFooter = "&""Arial,Gras""Page &P" ' Bas de page droite
.LeftMargin = Application.InchesToPoints(0.787401575) ' Marge de gauche
.RightMargin = Application.InchesToPoints(0.787401575) ' Marge de droite
.TopMargin = Application.InchesToPoints(0.984251969) ' Marge du haut
.BottomMargin = Application.InchesToPoints(0.984251969) ' Marge du bas
.HeaderMargin = Application.InchesToPoints(0.4921259845) ' Marge de l'entete
.FooterMargin = Application.InchesToPoints(0.4921259845) ' Marge du pied de page
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
End With
With ActiveSheet.PrintOut
End With
'AFFICHAGE DU RESULTAT
Application.ScreenUpdating = True
GoTo Fin
BBB:
ActiveWindow.WindowState = xlMaximized
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
ActiveSheet.PageSetup.PrintArea = "A1:J54" ' Délimitation de la plage d'impression
.LeftHeader = "&""Arial,Gras""BET NEAU" ' Entete haut gauche
.CenterHeader = "&""Arial,Gras""Nomenclature" ' Entete haut centre
.RightHeader = "&""Arial,Gras""&F" ' Entete haut droite
.LeftFooter = "&""Arial,Gras""&D" ' Bas de page gauche
.RightFooter = "&""Arial,Gras""Page &P" ' Bas de page droite
.LeftMargin = Application.InchesToPoints(0.787401575) ' Marge de gauche
.RightMargin = Application.InchesToPoints(0.787401575) ' Marge de droite
.TopMargin = Application.InchesToPoints(0.984251969) ' Marge du haut
.BottomMargin = Application.InchesToPoints(0.984251969) ' Marge du bas
.HeaderMargin = Application.InchesToPoints(0.4921259845) ' Marge de l'entete
.FooterMargin = Application.InchesToPoints(0.4921259845) ' Marge du pied de page
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
End With
With ActiveSheet.PrintOut
End With
ActiveWindow.WindowState = xlMaximized
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
ActiveSheet.PageSetup.PrintArea = "A55:J108" ' Délimitation de la plage d'impression
.LeftHeader = "&""Arial,Gras""BET NEAU" ' Entete haut gauche
.CenterHeader = "&""Arial,Gras""Nomenclature" ' Entete haut centre
.RightHeader = "&""Arial,Gras""&F" ' Entete haut droite
.LeftFooter = "&""Arial,Gras""&D" ' Bas de page gauche
.RightFooter = "&""Arial,Gras""Page &P" ' Bas de page droite
.LeftMargin = Application.InchesToPoints(0.787401575) ' Marge de gauche
.RightMargin = Application.InchesToPoints(0.787401575) ' Marge de droite
.TopMargin = Application.InchesToPoints(0.984251969) ' Marge du haut
.BottomMargin = Application.InchesToPoints(0.984251969) ' Marge du bas
.HeaderMargin = Application.InchesToPoints(0.4921259845) ' Marge de l'entete
.FooterMargin = Application.InchesToPoints(0.4921259845) ' Marge du pied de page
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
End With
With ActiveSheet.PrintOut
End With
'AFFICHAGE DU RESULTAT
Application.ScreenUpdating = True
GoTo Fin
Fin:
'MISE A JOUR DE LA BARRE D'ETAT
Application.StatusBar = Application.DisplayStatusBar
Application.StatusBar = True
Application.StatusBar = "Création de la nomenclature terminée....." 'dans la barre d'etat
End Sub
Le seul hic c'est que je perd la continuité dans le nombre de page imprimée.
Pour ce qui est des macros XL4, là j'ai besoin d'un coup de main Fred, car je ne sais pas comment l'utiliser.
Merci de ton aide