FitToPagesWide Leaving Extra Columns In Print Area

rootdown42

Board Regular
Joined
Jun 8, 2005
Messages
93
I'm using VBA code to loop through a bunch of rows and hide them based on cell values. Because of the performance issue encountered by recalculating page breaks when hiding/unhiding rows multiple times I inserted
Code:
ActiveSheet.DisplayPageBreaks = False

to speed up performance, which works great. I figured that at the end of the code I'd just reformat the breaks. Since I just need this to fit on one large 8 X 14 sheet I inserted
Code:
ActiveSheet.PageSetup.FitToPagesWide = 1

The problem is that when viewing the print preview there are still several empty columns to the right that are showing up on the page, wasting extra space. I highlighted/deleted every unused column just to be safe and reopened the file, but the problem persisted. When I manually adjust the scaling to 55% I can get it to fit perfect, but even manually checking "Fit to 1 page" shrinks it back down to 49% and the empty columns.

Anyone have any suggestions as to what else could be causing this? Any help is appreciated.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try this

Code:
With ActiveSheet.PageSetup
    .FitToPagesWide = 1
    .FitToPagesTall = 5 ' change 5 to suit
    .Zoom = False
End With
 
Upvote 0
Sorry, that additional code doesn't change anything. Excel still feels the need to include the empty extra columns.
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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