Instantly share code, notes, and snippets.

Embed
What would you like to do?
Excel VBA Remove Print Preview Lines/Page Break Lines/Dotted Lines for Workbook/All Sheets
' ----------------------------------------------------------------
' Procedure Name: RemovePrintLines
' Purpose: Remove all dotted/dashed print lines in the workbook
' Procedure Kind: Sub
' Procedure Access: Public
' Author: sb172a
' Date: 7/3/2018
' ----------------------------------------------------------------
Sub RemovePrintLines()
Application.ScreenUpdating = False
Dim WS As Worksheet
' For every worksheet in the current workbook
For Each WS In ActiveWorkbook.Worksheets
' Remove the print lines
WS.DisplayPageBreaks = False
Next WS
Application.ScreenUpdating = False
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment