ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   "Fit to page" in a group (https://www.excelbanter.com/excel-discussion-misc-queries/126488-fit-page-group.html)

chanceygardener

"Fit to page" in a group
 
in the setup I want "fit to page" to apply to each sheet in the group. I
thought it did last year but this year when I group all the spreadsheet and
do a print preview then change the set up to "fit to page" it only change the
page I am viewing. When I click next, I have to click set up again and "fit
to page". I thought changes in the group applied to the whole group.

JLatham

"Fit to page" in a group
 
Changes made directly on a sheet in a group will apply to all sheets in a
group. But the page setup (and other) attributes have to be set individually.

Here's a little macro code that would set all worksheets to the Fit to One
Page setting (both in height and width) at once. Use at your own risk <g
since you may not really want that on all sheets, which is why it doesn't
work on the group in the first place.

Sub OneTallOneWide()
Dim anySheet As Worksheet
For Each anySheet In Worksheets
anySheet.PageSetup.FitToPagesWide = 1
anySheet.PageSetup.FitToPagesTall = 1
Next
End Sub


"chanceygardener" wrote:

in the setup I want "fit to page" to apply to each sheet in the group. I
thought it did last year but this year when I group all the spreadsheet and
do a print preview then change the set up to "fit to page" it only change the
page I am viewing. When I click next, I have to click set up again and "fit
to page". I thought changes in the group applied to the whole group.


chanceygardener

"Fit to page" in a group
 
I copied this code into my spreadsheet but it didn't seem t work. what do
you think I did wrong? I tried it both on the spreadsheet I was using and
also on the spreadsheet I keep a lot of other macros. It seems to run but
with no effect so I must be doning something wrong. Note I haven't been
using VB very long so there is a lot I don't know.

"JLatham" wrote:

Changes made directly on a sheet in a group will apply to all sheets in a
group. But the page setup (and other) attributes have to be set individually.

Here's a little macro code that would set all worksheets to the Fit to One
Page setting (both in height and width) at once. Use at your own risk <g
since you may not really want that on all sheets, which is why it doesn't
work on the group in the first place.

Sub OneTallOneWide()
Dim anySheet As Worksheet
For Each anySheet In Worksheets
anySheet.PageSetup.FitToPagesWide = 1
anySheet.PageSetup.FitToPagesTall = 1
Next
End Sub


"chanceygardener" wrote:

in the setup I want "fit to page" to apply to each sheet in the group. I
thought it did last year but this year when I group all the spreadsheet and
do a print preview then change the set up to "fit to page" it only change the
page I am viewing. When I click next, I have to click set up again and "fit
to page". I thought changes in the group applied to the whole group.


chanceygardener

"Fit to page" in a group
 
Actually your code helped me figure out what i did last year to change all
the sheets in the group to print on one page. Instead of doing print preview
and then selecting one page t and one page w, if i group all the sheet I want
this to apply to and then select file, page set up, and then select one p w
and one p t, it does change them all. I tried that when I saw that was what
your code was trying to do. I would still like to get the code to work even
though my problem is solved so if you could help me with that I would
appreciated it thanks.

"JLatham" wrote:

Changes made directly on a sheet in a group will apply to all sheets in a
group. But the page setup (and other) attributes have to be set individually.

Here's a little macro code that would set all worksheets to the Fit to One
Page setting (both in height and width) at once. Use at your own risk <g
since you may not really want that on all sheets, which is why it doesn't
work on the group in the first place.

Sub OneTallOneWide()
Dim anySheet As Worksheet
For Each anySheet In Worksheets
anySheet.PageSetup.FitToPagesWide = 1
anySheet.PageSetup.FitToPagesTall = 1
Next
End Sub


"chanceygardener" wrote:

in the setup I want "fit to page" to apply to each sheet in the group. I
thought it did last year but this year when I group all the spreadsheet and
do a print preview then change the set up to "fit to page" it only change the
page I am viewing. When I click next, I have to click set up again and "fit
to page". I thought changes in the group applied to the whole group.



All times are GMT +1. The time now is 08:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com