Zoom a form : Application Windows « Application « VBA / Excel / Access / Word






Zoom a form

 

Private Sub UserForm_Initialize()
    LabelZoom.Caption = ActiveWindow.Zoom
'   Zoom
    With ScrollBarZoom
        .Min = 10
        .Max = 400
        .SmallChange = 1
        .LargeChange = 10
        .Value = ActiveWindow.Zoom
    End With
    
'   Horizontally scrolling
    With ScrollBarColumns
        .Min = 1
        .Max = 256
        .Value = ActiveWindow.ScrollColumn
        .LargeChange = 25
        .SmallChange = 1
    End With
    
'   Vertically scrolling
    With ScrollBarRows
        .Min = 1
        .Max = ActiveSheet.Rows.Count
        .Value = ActiveWindow.ScrollRow
        .LargeChange = 25
        .SmallChange = 1
    End With
End Sub

 








Related examples in the same category

1.Transform all windows into icons
2.Make sure that the scroll bars and status bar are hidden and that the formula bar is displayed:
3.Zooming a Window and Setting Display Options
4.Set the window position and size
5.Center application
6.To change the values of the WindowState, Width, and Height properties of the Excel application window, you must explicitly reference the Application object