Por favor, dígame cómo utilizar la programación Excel VBA para imprimir el formulario actual horizontalmente en papel A4. ¡Gracias!
Sub impresión()
<'
' impresión
'
'
Application.PrintCommunication = False
Con ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
Terminar con
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = ""
Application.PrintCommunication = False
Con ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = "" p>
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Aplicación. InchToPoints(0.7)
.TopMargin = Aplicación.InchesToPoints(0.75)
.BottomMargin = Aplicación.InchesToPoints(0.75)
.HeaderMargin = Aplicación.InchesToPoints( 0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomati
c
.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 = ""
Terminar con
Application.PrintCommunication = Verdadero
ActiveWindow.SelectedSheets.PrintOut Copias: =1, Intercalar: =Verdadero, _
IgnorarPrintAreas: =False
End Sub