vba zoom in hoogte en breedte

littlepete

Well-known Member
Joined
Mar 26, 2015
Messages
503
Office Version
  1. 365
Platform
  1. Windows
hallo ;)

dit is denk ik een meer wiskundige dan excelvraag:

ik heb een "voorstelling" die ik op een aantal computers wil weergeven, maar de schermen zijn allemaal verschillend.
de hoogte is altijd 70 rijen de breedte is altijd 47 kolommen.
alle pagina's staan gewoon onder elkaar om de 70 rijen begint een nieuwe pagina.
door te klikken op een cel in een pagina springt de macro naar de gevraagde pagina (=> activewindow.scrollrow)

hoe kan ik met een macro zorgen dat steeds de volledige pagina op het scherm staat bij het openen (auto_open)
dus: de hoogte van de pagina moet kleiner zijn dan de hoogte van t scherm en idem met de breedte ...

bedankt :) !
peter
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi,

Apologies, I still cannot speak Dutch :)

Is this what you need?
Code:
    Worksheets(1).Range("A1:AU70").Select
    ActiveWindow.Zoom = True
 
Upvote 0
hello rick ;)
i want each page having a range of exactly 70 rows and more or less 47 columns,
to fit on each computer screen, by zooming in or out, in other words:
zoom to fit a1:au1 on screen OR to fit a1:a69 on screen (a70 is first row of page two)
depending on the sizes of the used screen...
if i do one or the other there is a big chance the other side is too large ...

i'd like to get vba to get the combination of both :)
thanks :)
pete, belgium
 
Upvote 0
Hi, thanks for the translation.

I think the code I supplied will do that. Have you tried it? What happened?
 
Upvote 0
hello rick :)

i'm home here so i only have one monitor to try,
but i have the impression that it works well ;) !
i adjusted a bit the values...

i guess selecting a square more or less is ideal to fit on both wide monitors and old square monitors :) !

thanks for the help !!! so glad that works now :) !!!

thank you
pete, belgium
 
Upvote 0
i want each page having a range of exactly 70 rows and more or less 47 columns, ..
In that case, I think all you really need is to select A1:A70 (or is it A1:A69) before you do the ActiveWindow.Zoom
That way it is the height that will be the critical factor and just whatever columns will fit.
 
Upvote 0

Forum statistics

Threads
1,216,514
Messages
6,131,105
Members
449,618
Latest member
lewismillar

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