+ Reply to Thread
Results 1 to 7 of 7

Want Textbox on Each Page of MultiPage Form to Scroll to Top When Selected

  1. #1
    Registered User
    Join Date
    12-02-2012
    Location
    Silver Bay, MN
    MS-Off Ver
    Excel 2010
    Posts
    47

    Want Textbox on Each Page of MultiPage Form to Scroll to Top When Selected

    I have a MultiPage Form, UserForm_HELP, with nineteen pages (index 0-18). Each page has a textbox (textbox1...textbox19) with vertical scrollbar which displays if text extends beyond bottom of visible box. I wish each page to open scrolled to the top, rather than the bottom which seems to be the default. After my own trial and error, I found two pieces of code on-line that apparently worked for someone but don't work in my application (see below). I would appreciate help in finding a solution. Thank You!

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2013
    Posts
    3,051

    Re: Want Textbox on Each Page of MultiPage Form to Scroll to Top When Selected

    Hi there,

    See if the following code does what you need:

    Please Login or Register  to view this content.
    The above code assumes that your UserForm contains a Multipage control called MultiPage1.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    12-02-2012
    Location
    Silver Bay, MN
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Want Textbox on Each Page of MultiPage Form to Scroll to Top When Selected

    Greg, I appreciate your giving this a shot. Unfortunately it errors out. I have tried alternatives to no avail. It is now erroring out on Set pg line. See below.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2013
    Posts
    3,051

    Re: Want Textbox on Each Page of MultiPage Form to Scroll to Top When Selected

    Hi again,

    Those error messages suggest that the code has been entered in a standard VBA CodeModule, but it must be entered in the VBA CodeModule for the UserForm in question.

    The attached workbook contains a sample UserForm with a Multipage control and three TextBoxes.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-02-2012
    Location
    Silver Bay, MN
    MS-Off Ver
    Excel 2010
    Posts
    47

    Smile Re: Want Textbox on Each Page of MultiPage Form to Scroll to Top When Selected

    Greg, your solution works like a charm. Many thanks!! I will gladly boost your reputation. - Mandora

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    Waterlooville,England
    MS-Off Ver
    Office 2010
    Posts
    16,519

    Re: Want Textbox on Each Page of MultiPage Form to Scroll to Top When Selected

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2013
    Posts
    3,051

    Re: Want Textbox on Each Page of MultiPage Form to Scroll to Top When Selected

    Hi again,

    Many thanks for your feedback and also for the Reputation increase - much appreciated

    You're very welcome - glad I was able to help.

    Best regards,

    Greg M

+ 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