Page Breaks Displayed After Disconnect Monitors

%3CLINGO-SUB%20id%3D%22lingo-sub-1877139%22%20slang%3D%22en-US%22%3EPage%20Breaks%20Displayed%20After%20Disconnect%20Monitors%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1877139%22%20slang%3D%22en-US%22%3E%3CP%3EEvery%20time%20I%20lock%20my%20computer%20and%20disconnect%20from%20my%20external%20monitors%20with%20an%20Excel%20file%20open%2C%20page%20breaks%20are%20displayed%20on%20each%20tab%20when%20I%20reopen%20my%20computer.%20I%20have%20to%20manually%20remove%20them%20from%20each%20tab%20in%20Excel%20Options%20%2F%20Advanced%20-%20it%20is%20a%20real%20hassle.%20Is%20there%20a%20way%20to%20prevent%20this%20from%20happening%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1877139%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1877197%22%20slang%3D%22de-DE%22%3ESubject%3A%20Page%20Breaks%20Displayed%20After%20Disconnect%20Monitors%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1877197%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F865596%22%20target%3D%22_blank%22%3E%40TylerHansen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3ETools%20-%20Options%20-%20View%20checkmark%20'Page%20break'%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3Eand%20if%20it%20doesn't%20work%20that%20way%2C%20then%20VBA%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3ECopy%20the%20following%20VBA%20code%20into%20the%20module%20'This%20workbook'%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E'Code%3A%0A%0APrivate%20Sub%20Workbook_Open%20()%0A%0ADim%20i%20As%20Integer%0A%0AFor%20i%20%3D%201%20To%20ThisWorkbook.Sheets.Count%0A%0ASheets%20(i)%20.DisplayAutomaticPageBreaks%20%3D%20True%0A%0ANext%20i%0A%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3E-%20Open%20the%20VBA%20editor%20with%20Alt%20%2B%20F11%3C%2FSPAN%3E%20%3CSPAN%3E-%20Open%20and%20activate%20the%20Project%20Explorer%20with%20Ctrl%20%2B%20R%3C%2FSPAN%3E%20-%20Now%20mark%20the%20desired%20file%20with%20a%20double%20%3CSPAN%3Eclick%3C%2FSPAN%3E%20-%20%3CSPAN%3EDouble-click%20below%20this%20file%20on%20'This%20work%20folder'%3C%2FSPAN%3E%20%3CSPAN%3E-%20in%20the%20right%20half%20of%20the%20window%20is%20now%20the%20code%20window%20of%20'This%20workbook'%3C%2FSPAN%3E%20%3CSPAN%3E-%20insert%20the%20code%20there%3C%2FSPAN%3E%20-%20Save%20and%20the%20%3CSPAN%3EVBA%20editor%20with%20Alt%20%2B%20F4%3C%2FSPAN%3E%20%3CSPAN%3E-%20the%20macro%20will%20now%20be%20executed%20the%20next%20time%20the%20file%20is%20opened%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20I%20was%20able%20to%20help%20you.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E*%20Kindly%20Mark%20and%20Vote%20this%20reply%20if%20it%20helps%20please%2C%20as%20it%20will%20be%20beneficial%20to%20more%20community%20members%20reading%20here%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

Every time I lock my computer and disconnect from my external monitors with an Excel file open, page breaks are displayed on each tab when I reopen my computer. I have to manually remove them from each tab in Excel Options / Advanced - it is a real hassle. Is there a way to prevent this from happening?

1 Reply
Highlighted

@TylerHansen 

 

Tools - Options - View checkmark 'Page break'

 

and if it doesn't work that way, then VBA

Copy the following VBA code into the module 'This workbook'

 

'Code:

Private Sub Workbook_Open ()

Dim i As Integer

For i = 1 To ThisWorkbook.Sheets.Count

Sheets (i) .DisplayAutomaticPageBreaks = True

Next i

End Sub

 

- Open the VBA editor with Alt + F11 - Open and activate the Project Explorer with Ctrl + R - Now mark the desired file with a double click - Double-click below this file on 'This work folder' - in the right half of the window is now the code window of 'This workbook' - insert the code there - Save and close the VBA editor with Alt + F4 - the macro will now be executed the next time the file is opened

 

Hope I was able to help you.

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here