Not all recorded macros are re-usable. This print selection one is.
When you set your print area or use the Page Break Preview View, Excel will show you the page breaks on the grid. If this annoys or distracts you, here is how to remove them.
It’s a one-line macro that turns off the page breaks in the current sheet.
Sub TurnOffPageBreaks() ActiveSheet.DisplayPageBreaks = False End Sub
If you are new to macros then this blog post can take you through how to use them.
The above code can be copied and pasted into the code window.
If you want to turn page breaks off for all the sheets in the file use the code below.
Sub TurnOffAllPageBreaks() Dim ws For Each ws In Worksheets ws.DisplayPageBreaks = False Next ws End Sub
I hope these code snippets are useful.
I don’t like merged cells. Here is one more reason.
The Merge cells format has lots of issues. It can crash macros and stop you copying and pasting.
In less than a minute you can use a macro to solve the problem.
Center Across Selection takes a few mouse click to apply but it doesn’t have the issues Merge cells does.
A macro can do it much quicker – see how in this quick video.