+ Reply to Thread
Results 1 to 10 of 10

How do I use scroll bar to view very LONG label in User Form?

  1. #1
    Forum Contributor sauerj's Avatar
    Join Date
    11-11-2009
    Location
    Lafayette, IN
    MS-Off Ver
    Excel 2019
    Posts
    163

    Question How do I use scroll bar to view very LONG label in User Form?

    Hello, I have a Label in a User Form that has so many words (in the label) such that it requires the User Form to be so tall that it is not entirely visible on a monitor screen. Can some give me instructions on how to use a scroll bar to allow moving the User Form up & down, so to allow reading all of the Label content.
    I believe I am supposed to assign the Label to a Frame, and use the Frame scroll bars to move up & down. But, I can't figure out how to assign this lengthy text label to a frame. And, after that, I am not sure how to make the Frame scroll bars cause the User Form to go up & down.
    Can someone explain, or else point me to a good step-by-step instructional internet site on this matter? ... Thanks, sauerj
    Last edited by sauerj; 11-13-2010 at 11:53 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: How do I use scroll bar to view very LONG label in User Form?

    Is there a reason why you can't use a textbox with the locked property set to true to disable modification of the contents?
    Attached Files Attached Files
    Ben Van Johnson

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: How do I use scroll bar to view very LONG label in User Form?

    For the Label within a frame approach

    add the text to the label and size the label so all the text is displayed.
    In design mode drag the label within a Frame.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor sauerj's Avatar
    Join Date
    11-11-2009
    Location
    Lafayette, IN
    MS-Off Ver
    Excel 2019
    Posts
    163

    Thumbs up Re: How do I use scroll bar to view very LONG label in User Form?

    Thanks Mr. Pope, Got it working 100% as I want it!!! ... It took me awhile to realize that the Frame & UserForm height can be different in Design Mode versus the RunTime mode (Code driven). In Design Mode, the height is set big enough so to SEE all of the Label text. BUT, in RunTime mode, the Frame height must be LESS than the Label height for the ScrollBars to actually do their thing. Setting this shortened Frame height in the Initialize Code achieves this visual goal. Actually, in the end, the Frame height is set in the Initialize Code so to conform to its desired window size visible on the screen.
    After some struggle on this, I triple re-read your post and the light bulb clicked!
    Similarly, the Initialize Code can also set the height of the UserForm so that it also visually fits nicely on the screen, while in Design Mode the height of the UserForm can be as required, i.e. big enough so to allow seeing all of the Label text.

    Thanks, again, for your time, muchas gracias!!!

    Final code ended up as ...
    Please Login or Register  to view this content.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How do I use scroll bar to view very LONG label in User Form?

    Just out of curiosity: what text is so important that the use must be able to see the whole, even scrolling ? (in my view a userform must contain as little information as possible in order to present a view/picture that is evident at one glance).



  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How do I use scroll bar to view very LONG label in User Form?

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  7. #7
    Forum Contributor sauerj's Avatar
    Join Date
    11-11-2009
    Location
    Lafayette, IN
    MS-Off Ver
    Excel 2019
    Posts
    163

    Re: How do I use scroll bar to view very LONG label in User Form?

    Dear protonLeah,
    I had read on internet that TextBox was another way to go on this. I hadn't explored that yet. So, I took your example, and worked with TextBox Value to see if it would work for my needs.
    Background: My label text is for providing a full 8.5x11 page of written instructions to the user (they can also print the page if desired); this label contains nearly 8000 total characters of text. And so, to make this visually readable, it really HAS to have a Outline Numbering formatted structure which requires forcing line breaks and indenting the lines.
    Text Box Suitability for this Task: When I worked with the TextBox, that you kindly provided, I found that it didn't give me the ability to insert forced LINE BREAKS which I can do with the Label, so I was unable to install the desired Outline Numbering structure.
    Also, I wasn't able to install the text by simply directly typing in the Label while in Design Mode. It appears that you would have to type the TextBox value in the little DesignMode Value field, or else build a string variable in code, and dump this into the TextBox.value. This technique of building the text is 1-step more cumbersome than the Label path.
    Since I got the Label/Frame/Scrollbar approach to work, I'm good!

    Thanks for time; it is always good to learn other options that someday might come in handy!

  8. #8
    Forum Contributor sauerj's Avatar
    Join Date
    11-11-2009
    Location
    Lafayette, IN
    MS-Off Ver
    Excel 2019
    Posts
    163

    Re: How do I use scroll bar to view very LONG label in User Form?

    royUK, Thanks for the reminder!

    To those who are interested on details of this post: For the record, this whole thing is in WORD (not Excel). I put the question in Excel, as I knew the workings for all of this is identical and that I'd get a quicker answer in the Excel forum (versus the Word forum).

    If in Excel, I'd probably put the instructions in a sheet, and send the user there if you activates the macro (send him back when done). But, in WORD, there s NO other place to send the user. The massive Label of text was the only thing I could think of in order to achieve this goal. ...

    Hope this clarifies things! ... sauerj
    Last edited by sauerj; 11-13-2010 at 12:01 PM.

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How do I use scroll bar to view very LONG label in User Form?

    But, in WORD, there s NO other place to send the user
    .

    I think you are mistaken. Word has no limitations in this respect.

  10. #10
    Registered User
    Join Date
    11-17-2012
    Location
    mumbai
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: How do I use scroll bar to view very LONG label in User Form?

    Hi Thanks so much

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1