Microsoft 365 Impression en pdf sans les marges

membsa

XLDnaute Nouveau
Bonjour à tous,

J'ai un petit souci avec l'impression d'un fichier Excel au format PDF.
J'ai déjà mis les marges haut, bas, gauche et droite à 0 et l'entête et bas de page à 0 aussi. Cependant, il y a toujours une marge sur les quatre côtés.

Je vous remercie par avance pour votre aide.

Ando
 

Phil69970

XLDnaute Barbatruc
Bonjour @membsa

Je te propose ceci avec les paramètres d'impression à choisir

VB:
'La procédure impression ....
With Sheets("Ma feuille").PageSetup ' à adapter'
    .LeftMargin = Application.InchesToPoints(0.8) 'Marge gauche à adapter
    .RightMargin = Application.InchesToPoints(0.1)  'Marge droite à adapter
    .TopMargin = Application.InchesToPoints(0.8) 'Marge haut de page ou top à adapter
    .BottomMargin = Application.InchesToPoints(0.8) 'Marge bas de page si nécessaire à adapter
  
    'Orientation à choisir c'est l'un ou l'autre mais pas les 2
    .Orientation = xlLandscape 'Paysage à adapter
    '.Orientation = xlPortrait 'Portrait à adapter
    .PrintArea = "C4:M26" 'Zone d'impression à adapter
End With

*Merci de ton retour

@Phil69970
 
Dernière édition:

membsa

XLDnaute Nouveau
Bonjour @membsa

Je te propose ceci avec les paramètres d'impression à choisir

VB:
'La procédure impression ....
With Sheets("Ma feuille").PageSetup ' à adapter'
    .LeftMargin = Application.InchesToPoints(0.8) 'Marge gauche à adapter
    .RightMargin = Application.InchesToPoints(0.1)  'Marge droite à adapter
    .TopMargin = Application.InchesToPoints(0.8) 'Marge haut de page ou top à adapter
    .BottomMargin = Application.InchesToPoints(0.8) 'Marge bas de page si nécessaire à adapter
 
    'Orientation à choisir c'est l'un ou l'autre mais pas les 2
    .Orientation = xlLandscape 'Paysage à adapter
    '.Orientation = xlPortrait 'Portrait à adapter
    .PrintArea = "C4:M26" 'Zone d'impression à adapter
End With

*Merci de ton retour

@Phil69970
Bonjour Phil,

Merci pour ta réponse, je le test ce jour et te fais mes retours.

Bonne journée
 

Discussions similaires

Réponses
7
Affichages
625