+ Reply to Thread
Results 1 to 4 of 4

Using command buttons to move from one page to another in User Form

  1. #1
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    245

    Using command buttons to move from one page to another in User Form

    I have a User Form with 4 separate pages (multipage). I have a command button on each page. When the command button is clicked on a page , I want the user to either advance to the next sequential page or another page I specify. Looking for the code needed to make this happen. I think the reason I'm having trouble is because I think I need to create a variable for the different pages and I'm really struggling with how to set up variables.

    A sample workbook containing a UF with four pages is attached.

    Thanks,

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

    Re: Using command buttons to move from one page to another in User Form

    The .xlsx file that you attached doesn't have a user form.

    But I think code like this might help you
    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.

  3. #3
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    245

    Re: Using command buttons to move from one page to another in User Form

    Updated workbook with UF now attached. I pasted code in the UF code window button can't get it to work.
    Attached Files Attached Files

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

    Re: Using command buttons to move from one page to another in User Form

    The Event for each button has to call the appropriate sub.
    Next Page and Previous Page buttons are usually outside of a Multipage control to avoid having to put the same code in several command button's events.

    I added two command buttons (butNext and butPrevious) to the user form and had your CommandButtons 1, 2 and 3 call the NextPage sub.

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

+ 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. [SOLVED] Add Command Buttons to User Form at Runtime
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 12-16-2013, 07:04 PM
  2. Using Command Buttons to Move Cursor
    By Tobre in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2010, 04:01 PM
  3. Move Command Buttons
    By LoveCandle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2009, 01:56 AM
  4. User Form Option & Command Buttons
    By Information Hog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2005, 06:37 PM
  5. [SOLVED] How to make command buttons move among worksheets?
    By Rick in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-21-2005, 01:05 PM

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