Changing Boolean settings | VBA Excel @ ExcelOptimize.Com
Unfortunately, the only way to get rid of the page break display is to open the Excel Options dialog box, click the Advanced tab, and scroll down until you find the Show Page Breaks check box. If you turn on the macro recorder when you change that option, Excel generates the following code:
ActiveSheet.DisplayPageBreaks = False
On the other hand, if page breaks are not visible when you record the macro,
Excel generates the following code:
ActiveSheet.DisplayPageBreaks = True
This may lead you to suspect that you need two macros: one to turn on the page break display and one to turn it off. Not true. The following procedure uses the Not operator to effectively toggle the page break display from True to False and from False to True:
Sub TogglePageBreaks()
On Error Resume Next
ActiveSheet.DisplayPageBreaks = Not _
ActiveSheet.DisplayPageBreaks
End Sub
The first statement ignores an error that occurs if the active sheet is a chart sheet. (Chart sheets don’t display page breaks.) You can use this technique with any settings that have Boolean (True or False) values.

This post placed under VBA Excel , boolean, Excel, setting, VBA code by Andrian
Top incoming search terms for this post
You might wanna see also these VBA Excel :
Preventing Users from Inserting More Worksheets -
Preventing Users from Printing a Workbook -
Preventing Save As in a Workbook -
Loading Add-ins Automatically -
Do-Until loop -
Do-While loop -
Nested For-Next -

Leave a Reply