Adding a srcollbar to a userform

Posted on 2006-04-20
Last Modified: 2013-12-25
I've setup a userform and filled it with textboxes and labels at runtime.

The number of controls that fill the userform change depending on user input.

The number of controls can get pretty long so instead of changing the height of the userform I leave the userform height constant and from the userform properties I select
KeepScrollsBarsVisible = 2 - fmScrollBarsVertical and ScrollBars = 2 - fmScrollBarsVertical.

I have also tried playing with the ScrollHeight and ScrollWidth properties.

When the userform is run the place for the scrollbar and the arrows at either end are visible but the scrollbar itself is not.

How do I get the useform to show the scrollbar so the user can scroll down the userform?
Question by:SassMan

    Author Comment

    What do you mean Moved?

    Author Comment

    LVL 19

    Expert Comment

    Hello SassMan,

    VB Forms do not support scroll bars. You can add a scroll bar and after some very complicated code get scrolling controls that scroll with the scroll bar. I dont recommend this, it will take a long time to code all this up.

    What you should consider is a tab control. You can dynamically add/remove tabs for more "form space"


    Author Comment

    Thanks for that.

    In excel vba, why do userforms have numerous scrollbar properties then?
    LVL 19

    Accepted Solution

    I dont do VBA I only do VB. I couldn't realy advise you on VBA, are you working on a VBA project?


    Author Comment


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now