Share via

Apply same margin to all sheets without changing page orientation

Anonymous
2011-12-27T17:23:09+00:00

Hello,

I normally select all worksheets in a workbook then change the margins. Unfortunately, that also makes the page orientation of the current page the orientation to all other worksheets.

Is there a way in which I can apply customized margins that will apply to all pages, but keep the page orientation intact?

If not, is there a way I can apply the new margins only to the pages with the same orientation only?

Thanks a bunch.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2011-12-27T18:57:18+00:00

Using CTRL + Click you can select just the sheets with the same orientation which..........assuming you know which are which.

Or you could use VBA to cycle through the sheets applying your new margins without affecting orientation.

Sub marg()

Dim ws As Worksheet

For Each ws In ActiveWorkbook.Worksheets

 With ws.PageSetup

        .LeftMargin = Application.InchesToPoints(1.75)

        .RightMargin = Application.InchesToPoints(1.75)

        .TopMargin = Application.InchesToPoints(2.25)

        .BottomMargin = Application.InchesToPoints(1.25)

        .HeaderMargin = Application.InchesToPoints(0.5)

        .FooterMargin = Application.InchesToPoints(0.5)

 End With

 Next ws

End Sub

Gord

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2011-12-28T17:58:24+00:00

    Good to hear.

    Glad you were able to work around the extra "which" in the instructions<g>

    Gord

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-12-28T17:25:31+00:00

    Yup, that'll do it!

    Thanks a bunch.

    Was this answer helpful?

    0 comments No comments