Setting normal view returns to page break view

MrPez

Board Regular
Joined
Jan 28, 2010
Messages
128
I have some code that copies a worksheet to a new workbook and does a little formatting, nothing complicated.

My problem is that I want to set 'normal' view so it doesn't have the page numbers on.

If I step through my code it works fine, but for some reason if I run it in one go, it reverts to page break view??? I've put a pause in at the end and this confirms that the code works, but just reverts for some reason when the macro is finished.

Here is the code:
Code:
'Select and copy summary sheet to new workbook
    Sheets("Summary sheet").Select
    Sheets("Summary sheet").Copy


'Remove formulae and any notes not on the report
    Columns("A:K").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues
    Columns("L:BJ").ClearContents
    Rows("116:776").ClearContents
    ActiveSheet.Shapes("Button 5").Delete


'unlock cells to be edited by BSP unit
    Range("A53:K62").Select
    Selection.Locked = False
    Selection.FormulaHidden = False


'Protect Sheet
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    ActiveWindow.SmallScroll Down:=-45
    Range("A1").Select
    
'set normal view
    ActiveWindow.View = xlNormalView

Any ideas where I'm going wrong?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top