Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Impresión segun hojas seleccionadas

publicado
Hola tengo una macro que imprime varias hojas de un libro Excel, me gustaría poder hacerla un poco mas sofisticada hay veces que alguna hoja no habría que imprimirla por no tener información como se podría hacer que al imprimir seleccionara las hojas a imprimir.

adjunto la macro que tengo actualmente que me imprime todo

Sub IMPRIMIRTODOS()
Sheets("RANGOS").Select
Application.GoTo Reference:="PORTADA"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"

Sheets("DEM").Select
Application.GoTo Reference:="HOJADEM"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"

Sheets("ALBA").Select
Application.GoTo Reference:="HOJAALBA"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"

Sheets("CAR").Select
Application.GoTo Reference:="HOJACAR"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"

Sheets("FONTA").Select
Application.GoTo Reference:="HOJAFONT"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"

Sheets("VEN").Select
Application.GoTo Reference:="HOJAVEN"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"

Sheets("AR").Select
Application.GoTo Reference:="HOJAAR"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"

Sheets("RES").Select
Application.GoTo Reference:="HOJARES"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"

Sheets("SEG").Select
Application.GoTo Reference:="HOJASEG"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"

Sheets("PCI").Select
Application.GoTo Reference:="HOJAPCI"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"

Sheets("RESUMEN").Select
Application.GoTo Reference:="HOJARESUMEN"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Application.GoTo Reference:="R1C1"
End Sub

Muchas gracias
 

Featured Replies

publicado
Hace 18 horas, macasillasg dijo:

hay veces que alguna hoja no habría que imprimirla por no tener información

lo que debes comentar es "que es" (exactamente) lo que determina que una hoja se imprima o no (???)

a menos que quieras revisar y memorizar (o ya sepas) cuales si o no y después seleccionarlas del formulario (?)

saludos,
hector.

publicado
  • Autor

Es justo lo que quería poder seleccionar las hojas a imprimir lo único que ahora lo tengo que integrar con esta macro para que me lo imprima en PDF con el nombre de la celda configurada.

 

Sub IMPPDF()
' pdf Macro
    Sheets(Array("RANGOS", "DEM", "ALBA", "CAR", _
        "FONT", "ELE", "VEN", "AR", "RES", "SEG", "PCI", _
        "RESUMEN")).Select
    Sheets("RANGOS").Activate
    ActiveWindow.TabRatio = 0.924
 
   
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
        "C:\Datos\Excel\pres\" + Cells(1, 4) + ".pdf", Quality:=xlQualityStandard, _
         IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
         False
    Sheets("MENU").Activate
End Sub
 
 
Muchas gracias

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.