Scroll Frame by Frame

Hmerman

Board Regular
Joined
Oct 2, 2016
Messages
102
Hello,
Hope you are well.

I have a Userform with a 2100 height. On this Userform is Frame14 with a 2000 height and scrollbar set Vertically to a 1950 height. On Frame14 is 5 different Frames (Frame1, Frame2, ect).

What I want to do is if a user clicks the scrollbar the scrollbar should upon the click bring into view the next frame on Frame14.
For instance:
Code:
Private sub Frame14_Scrollbar_Click()
  Dim y as Integer

For y = 1 to 5
 If Me.Controls(Frame & y).Value = True Then
        With Frame14
           .ScrollHeight = Me.Controls(Frame & y).Height
       End with

Exit sub
    Else
 End if
Next y

End sub

If this is possible, can someone please give me a clue or advice on how to write this code?

Regards
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Update:
I was wondering that a simpler solution would be to set the scrolling increment to the height of the frames i.e. 354.

Can you do that in the properties window?
 
Upvote 0
Just curious:
Why do you have such a large UserForm?

Have you ever thought of using MultiPages on your Userform?

A multipage can be used like having 5 or 6 or more Userforms setting on top of each other.
Want to see UserForm 1 just click a Tab want to see Userform2 click it's tab.

This way your Userform could have room for lots and lots of Controls arranged by category. And be no larger then your screen no need to scroll down.
 
Upvote 0
Just curious:
Why do you have such a large UserForm?
Hello. The height of the Userform is just to accommodate the largest Frame on screen which is 354 and I multiplied this with 5 as well as spaced the smaller Frames to fit in the middle of the 354 height, therefore making for such a huge form. All the Frames when they are stacked end to end actually fit on a Userform with a height of 1016. The Userforms will be used to assess the environment by answering Option button questions and taking photos that will be imported on the Sheet, saved to pdf and mailed to the manager.

Just curious:
Have you ever thought of using MultiPages on your Userform?
Yes I have. I am designing three different UI's for the same Userform, one scrolling vertical, one scrolling Horizontal and a Multipage one (which is the most practical, as you stated). The reason is I want to force the assessor to move to the next Frame and if you click scroll and it jumps to the next Frame, the User will have to answer.

Of course adding a next button that jumps to a next Multipage achieves the same.:confused: So you do have a point.

I will reconsider as time is an issue with this Userform.

Thanks for your voice of reason.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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