+ Reply to Thread
Results 1 to 8 of 8

VBA Userform Scrollbars - need to change their size

  1. #1
    Registered User
    Join Date
    07-12-2011
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    22

    VBA Userform Scrollbars - need to change their size

    Hi, I have added some code (shown below) to my userform so when a user clicks on a command button the userform is enlarged and scrollbars appear both horizontally and vertically. This is some functionality for the visually impaired so they can zoom in and then use the scroll bars.

    The problem is that they seem very small on the screen. As this is for the visually impaired I need them to look larger so they can get to them. I know that if you add a scrollbar using the toolbox you can then use the properties to set the height and width but how do I do this within the code below.

    Many thanks in advance.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA Userform Scrollbars - need to change their size

    Any properties in the properties box can be manipulated with code if you qualify the statement so:

    Please Login or Register  to view this content.
    and so forth.

    You can change multiple properties by using a with statement:

    Please Login or Register  to view this content.
    You may have to change the code if you changed the name when you placed them on the userform.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    07-12-2011
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: VBA Userform Scrollbars - need to change their size

    Hi, thanks for your reply and examples. I tried adding the code you suggested but I can't get it to work. I think the problem is that when I add the scrollbars using the commandbutton I don't know what they are called. I therefore get an error that highlights ScrollBar1 as the problem. I thought that maybe when they were added it would just name them ScrollBar1 and ScrollBar2 but that doesn't seem to be the case. Is there a way to name them when they are added and then I can use the code suggested to adjust the sizes?

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA Userform Scrollbars - need to change their size

    Can you attach an your workbook as an example?

    I went back over your code and I'm afraid I misunderstood? Are you using an excel userform? or you've created a userform out of a sheet?

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: VBA Userform Scrollbars - need to change their size

    The scroll bars that "come with" the userform are different that a ScrollBar control that you can add.
    Their appearance, size and location cannot be altered much other than showing or not showing them.
    If you want large, easy to see scroll bars, you'll have to use ScrollBar controls.

    Xero Solus, create a UF with a command button and two textboxes and run this code, it will show you about a userform's scroll bars
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: VBA Userform Scrollbars - need to change their size

    @Mike

    Is that to me? Or the OP?

  7. #7
    Registered User
    Join Date
    07-12-2011
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: VBA Userform Scrollbars - need to change their size

    I have attached an example to show you. If you click on the Start Decision Tool button you will then see the userform. At the bottom left corner of the form is a Visually Enhanced Version command button. If you click this the userform zooms in but you will see the scroll bars at the right and bottom seem really small. I need to try and make them bigger if possible.
    Attached Files Attached Files

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: VBA Userform Scrollbars - need to change their size

    You cannot make those scroll bars bigger. You have to add ScrollBar controls, have those controls mimic the userform's scroll bars, and make those the size you want.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to print a Userform with Scrollbars?
    By sholas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2011, 07:10 PM
  2. Userform textbox vertical scrollbars not at bottom limit - show more...
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2009, 08:59 PM
  3. How can I activate scrollbars in an own userform?
    By Rolf Zäziwil in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-04-2006, 12:10 PM
  4. [SOLVED] Scrollbars on a Userform
    By TimT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2005, 06:05 PM
  5. userform when called doesn't show scrollbars
    By gradientS in forum Excel General
    Replies: 1
    Last Post: 04-10-2005, 04:50 PM

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