How to grab the Page setup "ZOOM" setting when "FIT TO" is selected

MedievalMan

Board Regular
Joined
Dec 14, 2004
Messages
57
For many of our template layouts, "Fit to page" is selected.

When you go to page setup, the corresponding ZOOM % is also displayed.

What I'm trying to do is: a routine that inserts logo, header and footer text to look be the same size for each tab.

Since Excel zooms the header/footer depending on the zoom % you have selected (or fit to), what I do is divide the font size and picture size by the zoom first, so that way when it prints the headers/footers are the same size throughout the different worksheets.

The problem I'm having is:

<code>
Zoom = Worksheets(wsname).PageSetup.Zoom
</code>

The Zoom level is 0 if "Fit to page" is still selected.

Now, I can manually go to every page and selected "Adjust to" instead of "Fit to", but I cannot record a macro to do that, since when I record while doing this manually, I get the following (snippet only):

<code>
ActiveSheet.PageSetup.Zoom = 85
</code>

So, I need a way to be able to grab what the zoom level is when set to "Fit To Page", or any other method that might help.

Thanks in advance,

Matt Lawson
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Thanks Andrew, it worked like a charm!

I've been trying to figure that one out for a while.. I see "SendKeys" solve some problems otherwise unsolvable. :)
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,693
Members
448,979
Latest member
DET4492

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