Adding Vertical and Horizontal Scrollbars in a userform using Userform_Activate method

CakzPrimz

Board Regular
Joined
Oct 6, 2017
Messages
57
Folks,

I have to add both vertical and horizontal scrollbars in a userform, so far I have this code below for horizontal scrollbars only.
Code:
Private Sub UserForm_Activate()
    With Me
    .ScrollBars = fmScrollBarsHorizontal
    .ScrollWidth = .InsideWidth * 1.5
    End With
End Sub

The second, how set the position of top scrollbar (vertical) and left scrollbar (horizontal) so it could like a freeze pane?

Thank you for your help and assistance

Best regards,
Prima
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Folks,

I have to add both vertical and horizontal scrollbars in a userform, so far I have this code below for horizontal scrollbars only.
Code:
Private Sub UserForm_Activate()
    With Me
    .ScrollBars = fmScrollBarsHorizontal
    .ScrollWidth = .InsideWidth * 1.5
    End With
End Sub

The second, how set the position of top scrollbar (vertical) and left scrollbar (horizontal) so it could like a freeze pane?

Thank you for your help and assistance

Best regards,
Prima
If I understand correctly, you could place a scrollable frame control at the bottom half of the userform and place your buttons, textboxes etc inside the frame .. That way, you could keep the top half of the userform frozen when scrolling the controls thus imitating the freeze pane feature in excel.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

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