+ Reply to Thread
Results 1 to 8 of 8

VBA Userform Re-size or Scroll Bar solution

  1. #1
    Forum Contributor
    Join Date
    02-13-2012
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    105

    VBA Userform Re-size or Scroll Bar solution

    I have made two different attempts to resolve a problem I am having with my userform not displaying correctly on different screen resolutions.

    Please Login or Register  to view this content.
    None seem to work - can any point out the error of my ways?

    Sample workbook attached.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA Userform Re-size or Scroll Bar solution

    Cobbling together your 2 attempts where the userform is sized to the app window and the scrollbar to scroll only to show all available controls...

    Please Login or Register  to view this content.
    You only need to define the ScrollHeight as basically the top of the 'lowest' control + its height + a little for luck.

  3. #3
    Forum Contributor
    Join Date
    02-13-2012
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    105

    Re: VBA Userform Re-size or Scroll Bar solution

    Please Login or Register  to view this content.
    Changed the code to Userform1 to refelct name of form and now get "Ambiguous Name Detected ;UserForm1_Initialize

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA Userform Re-size or Scroll Bar solution

    Quote Originally Posted by gtudor View Post
    Changed the code to Userform1 to refelct name of form and now get "Ambiguous Name Detected ;UserForm1_Initialize
    Hi,

    You should not change that. If you do, the code will not run.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA Userform Re-size or Scroll Bar solution

    And if you have an existing Initialize event then the codes must be combined into 1.

  6. #6
    Forum Contributor
    Join Date
    02-13-2012
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    105

    Re: VBA Userform Re-size or Scroll Bar solution

    Brilliant - thanks.

    Just entered the code below and the form now fits the width of the screen but I need to see some of the spreadsheet behind it. What should I do to reduce the width by 50%?

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-13-2012
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    105

    Re: VBA Userform Re-size or Scroll Bar solution

    Brilliant - thanks.

    Just entered the code below and the form now fits the width of the screen but I need to see some of the spreadsheet behind it. What should I do to reduce the width by 50%?

    Please Login or Register  to view this content.

  8. #8
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA Userform Re-size or Scroll Bar solution

    Please Login or Register  to view this content.

+ 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. Scroll Bar Solution Required.
    By Freddy7 in forum Excel General
    Replies: 1
    Last Post: 05-18-2015, 04:04 AM
  2. How do I get the scroll distance of a userform listbox scroll bar...
    By Rob Frankham in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-31-2014, 04:23 PM
  3. Lock size of horizontal scroll bar
    By wayneg in forum Excel General
    Replies: 6
    Last Post: 02-04-2014, 05:21 AM
  4. Replies: 1
    Last Post: 02-26-2011, 08:22 AM
  5. Vertical Scroll Bar Size
    By NuNn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-24-2009, 04:17 PM
  6. how do I change the size of vertical scroll bar
    By Peg B in forum Excel General
    Replies: 6
    Last Post: 07-29-2006, 09:50 AM
  7. [SOLVED] window size/scroll
    By David in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-19-2006, 10:55 AM

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