Zoom vba userform

bensonsearch

Well-known Member
Joined
May 26, 2011
Messages
844
Hi All,

I have tried so many different ways of zooming to keep the relationship of controls vs form.

I have made the below with notes and wish to share it :)

its long and can be made smoother but works great

the form here is named Record

Code:
'zoom form
Dim asd As Variant
Dim dsa As Variant
Dim nhigh As Variant
Dim nwid As Variant
Dim heg As Long
Dim wid As Long
Dim avg As Long
 
asd = 525.75 'height of form in edit view (original height)
dsa = 758.25 'width of form in edit view (original width)
 
nhigh = asd / Record.Height
nwid = dsa / Record.Width
 
nhigh = nhigh * 100
nwid = nwid * 100
 
heg = 100 - nhigh
wid = 100 - nwid

avg = (heg + wid) / 2
 
Record.Zoom = Record.Zoom + avg
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,948
Latest member
UsmanAli786

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