XL 2013 Fixation des marges d'une feuiile

sitaleb

XLDnaute Nouveau
j'ai enregistré un macro pour impression , après avoir définie les marges de la feuille , mais après avoir ouvrir la feuille dans un autre PC j'aurai d'autre marges qui ne correspond pas la forme voulu. je demande de m'indiquer comment fixer ces marges?.
 

JCGL

XLDnaute Barbatruc
Re : Fixation des marges d'une feuiile

Bonjour à tous,
Bonjour à toi aussi.

Ceci dans le ThisWorkbook :

VB:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
    With ActiveSheet.PageSetup
        .PrintTitleRows = ""
        .PrintTitleColumns = ""
        .LeftHeader = ""
        .CenterHeader = ""
        .RightHeader = ""
        .LeftFooter = ""
        .CenterFooter = ""
        .RightFooter = ""
        .LeftMargin = Application.InchesToPoints(0.393700787401575)    ' correspond à une marge de 1
        .RightMargin = Application.InchesToPoints(0.393700787401575)    ' correspond à une marge de 1
        .TopMargin = Application.InchesToPoints(0.393700787401575)    ' correspond à une marge de 1
        .BottomMargin = Application.InchesToPoints(0.393700787401575)    ' correspond à une marge de 1
        .HeaderMargin = Application.InchesToPoints(0.393700787401575)    ' correspond à une marge de 1
        .FooterMargin = Application.InchesToPoints(0.393700787401575)    ' correspond à une marge de 1
        .PrintHeadings = False
        .PrintGridlines = False
        .PrintComments = xlPrintNoComments
        .CenterHorizontally = True
        .CenterVertically = True
        .Orientation = xlPortrait
        .Draft = False
        .PaperSize = xlPaperA4
        .FirstPageNumber = xlAutomatic
        .Order = xlDownThenOver
        .BlackAndWhite = False
        .Zoom = 100
        .PrintErrors = xlPrintErrorsDisplayed
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = False
        .ScaleWithDocHeaderFooter = True
        .AlignMarginsHeaderFooter = True
        .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
End Sub

A+ à tous
 

Discussions similaires

Statistiques des forums

Discussions
312 230
Messages
2 086 427
Membres
103 206
dernier inscrit
diambote