Bienvenido a la mayor comunidad de usuarios EXCEL

Regístrate gratis ahora para ver contenidos y descargas sin restricciones!

Regístrate gratis

Borrar contenido fuera del área de impresion

Fernando Reyes

New member
Registrado
4 Ago 2022
Mensajes
7
Buenas tardes, tengo un archivo con varias hojas, me gustaría saber si alguien conoce la forma de borrar el contenido exterior del área de impresión de todas las hojas.

Gracias
 
Solución
Por aburrimiento...:

Prueba:

Código:
Sub BorrarFueraPrintArea()
    Dim h As Worksheet, r As Range, a As String, xCell As Range
    Application.ScreenUpdating = False
    For Each h In Sheets
        a = h.PageSetup.PrintArea
        If a <> "" Then
            For Each xCell In h.UsedRange
                If Intersect(xCell, h.Range(a)) Is Nothing Then xCell.Clear
            Next xCell
        End If
    Next h
    Range(a).Select
End Sub



Saludos.

NOTA: Si es una hoja con "poca" información a eliminar.... también sirve. (Digo.. para no hacer lo mismo);-)
Por aburrimiento...:

Prueba:

Código:
Sub BorrarFueraPrintArea()
    Dim h As Worksheet, r As Range, a As String, xCell As Range
    Application.ScreenUpdating = False
    For Each h In Sheets...
Para poder visualizar el resto de este tema y sus adjuntos:
. Si nunca te has registrado puedes registrarte gratis aquí
. Si ya te has registrado debes
iniciar sesión aquí
 

Adjuntos

    Sin permisos de acceso
Volver
Arriba