Auto ajustar el contenido a una sola hoja en Excel
Necesito que me ayudes, necesito una macro en excel para que esta automaticamente ajuste el contenido de un libro para que este siempre se imprima en una sola hoja y no salga en dos. ¿Me podras ayudar en esto?
Necesito que por ejemplo se reduzca el tamaño de la letra y se ajuste el tamaño de las columnas para que la informacion contenida en el libro siempre se imprima en una hoja.
Necesito que por ejemplo se reduzca el tamaño de la letra y se ajuste el tamaño de las columnas para que la informacion contenida en el libro siempre se imprima en una hoja.
1 Respuesta
Respuesta
1
1
Anónimo
Ok, mira para eso no necesitas macro...
En la hoja donde tienes la informacion que quiere ajustar,
entra en Vista Preeliminar, hay tiene varias herramientas para ajustar el texto
pued entra a Configuracion, o a salto de Pagina...
En la hoja donde tienes la informacion que quiere ajustar,
entra en Vista Preeliminar, hay tiene varias herramientas para ajustar el texto
pued entra a Configuracion, o a salto de Pagina...
Ok ,muchas gracias por tu respuesta.
De manera manual si lo sé hacer, pero varios usuarios que tienen contacto con el libro de excel no saben hacerlo, no habra una forma de que una macro lo haga de manera automatica?
Gracias
De manera manual si lo sé hacer, pero varios usuarios que tienen contacto con el libro de excel no saben hacerlo, no habra una forma de que una macro lo haga de manera automatica?
Gracias
Dame las caracteristicas... cuantas columnas y cuantas filas quieres que se impriman en la hoja...
Para desarrollar la macro..
Para desarrollar la macro..
Ok, muchas gracias por tu ayuda.
Las columnas serian hasta la letra F y las filas varian entre 24 hasta 38, pero con 38 filas estaria perfecto.
GrACIAS.
Las columnas serian hasta la letra F y las filas varian entre 24 hasta 38, pero con 38 filas estaria perfecto.
GrACIAS.
Copia y pega esta macro
Sub MyMacro()
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints(0.16)
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints(0.85)
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.87)
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints(0.89)
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints(0.56)
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints(0.49)
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints(0.68)
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints(0.98)
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints(0.26)
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintPreview
ActiveSheet.PageSetup.PrintArea = "$A$1:$G$38"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$38"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$41"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$38"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.87)
.RightMargin = Application.InchesToPoints(0.89)
.TopMargin = Application.InchesToPoints(0.98)
.BottomMargin = Application.InchesToPoints(0.68)
.HeaderMargin = Application.InchesToPoints(0.26)
.FooterMargin = Application.InchesToPoints(0.49)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 300
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
ActiveWindow.SelectedSheets.PrintPreview
Range("A1").Select
End Sub
Sub MyMacro()
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints(0.16)
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints(0.85)
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.87)
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints(0.89)
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints(0.56)
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints(0.49)
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints(0.68)
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints(0.98)
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints()
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints()
.RightMargin = Application.InchesToPoints()
.TopMargin = Application.InchesToPoints()
.BottomMargin = Application.InchesToPoints()
.HeaderMargin = Application.InchesToPoints(0.26)
.FooterMargin = Application.InchesToPoints()
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveWindow.SelectedSheets.PrintPreview
ActiveSheet.PageSetup.PrintArea = "$A$1:$G$38"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$38"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$41"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$38"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.87)
.RightMargin = Application.InchesToPoints(0.89)
.TopMargin = Application.InchesToPoints(0.98)
.BottomMargin = Application.InchesToPoints(0.68)
.HeaderMargin = Application.InchesToPoints(0.26)
.FooterMargin = Application.InchesToPoints(0.49)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 300
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
ActiveWindow.SelectedSheets.PrintPreview
Range("A1").Select
End Sub
ok muchas gracias.
Si necesitara modificar la macro para que en lugar de 38 filas sean solo 24, que datos necesito modificar?
Gracias por todo.
Si necesitara modificar la macro para que en lugar de 38 filas sean solo 24, que datos necesito modificar?
Gracias por todo.
En esta paste donde dice 38 solo ponle 24
ActiveSheet.PageSetup.PrintArea = "$A$1:$G$38"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$38"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$41"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$38"
ActiveSheet.PageSetup.PrintArea = "$A$1:$G$38"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$38"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$41"
ActiveSheet.PageSetup.PrintArea = "$A$1:$F$38"
Ok, muchas gracias.
Acabo de realizar la prueba y teniendo las 38 filas y las 6 columnas con información me las imprime en 4 hojas y no en 1 como la necesitaria. En vista preliminar solo me muestra una hoja, pero al imprimir me imprime las 4. Necesitaria que esas 4 hojas se autoajustaran automaticamente a solo 1 hoja para que cuando impriman solo salga todo en 1 sola hoja.
Gracias
Acabo de realizar la prueba y teniendo las 38 filas y las 6 columnas con información me las imprime en 4 hojas y no en 1 como la necesitaria. En vista preliminar solo me muestra una hoja, pero al imprimir me imprime las 4. Necesitaria que esas 4 hojas se autoajustaran automaticamente a solo 1 hoja para que cuando impriman solo salga todo en 1 sola hoja.
Gracias
Finaliza la pregunta para que no me aparesca como pendiente...
- Compartir respuesta
- Anónimo
ahora mismo