# Zoom vba userform



## bensonsearch (Aug 25, 2011)

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


```
'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
```


----------

