yuebu 发表于 2021-6-25 10:52:05

解决excel 页眉被遮挡问题

Sub 宏2()
'
' 宏2 宏
'

'

    Application.PrintCommunication = True

    Application.PrintCommunication = False
    With ActiveSheet.PageSetup

      .PrintHeadings = False '
      .PrintGridlines = False '
      .PrintComments = xlPrintNoComments
      .PrintQuality = 600
      .CenterHorizontally = True
      .CenterVertically = False '
      .Orientation = xlLandscape
      .Draft = False '
      .PaperSize = xlPaperA3
      .FirstPageNumber = xlAutomatic
      .Order = xlDownThenOver
      .BlackAndWhite = True '
      .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
    Application.PrintCommunication = True
End Sub


页: [1]
查看完整版本: 解决excel 页眉被遮挡问题