Forum Discussion

ChrisBShep's avatar
ChrisBShep
Copper Contributor
Sep 06, 2023

hide print area for whole workbook

Excel (Office Pro+ 2016) has randomly started showing the print area in every worksheet in every workbook. 

 

The only method I've found to hide them again involves File - Options - Hide Page Breaks, but this has to be done sheet by sheet. I have many workbooks and many many sheets in each... this is not a solution. Especially as they reappear again randomly... 

 

Any ideas on a better solution? 

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor

    ChrisBShep They re-appear anytime you access print features for a sheet such as print preview (not sure what else triggers it). This macro clears them from the activeworkbook (all worksheets):

    Sub StopShowingPagbreaks()
        Dim sh As Worksheet
        For Each sh In ActiveWorkbook.Worksheets
            sh.DisplayPageBreaks = False
        Next
    End Sub
    • ChrisBShep's avatar
      ChrisBShep
      Copper Contributor
      Hi Jan,

      Thanks for your reply. I've no idea why it's suddenly started happening, as I'm not doing anything differently, and am not accessing print features.

      I'm aware of the macro workaround, but that would mean converting xlsx to xlsm (all my workbooks) and this will cause issues when sharing by email (given my company's hyper-active IT security). It's not really a long-term solution, but thanks any way...
      • JKPieterse's avatar
        JKPieterse
        Silver Contributor
        I just wanted to share the macro in case you needed a quick fix for any workbook open at that moment.

Resources