+ Reply to Thread
Results 1 to 7 of 7

Assigning action to user form - macros

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    42

    Assigning action to user form - macros

    Hi

    I've set up a user form which gives you the option of 12 items. What I want to do is depending on which one is selected, that when you press ok, it goes to the tab name that's been selected.

    For example.

    Tab list - P1 P2 P3 P4
    If P1 is selected it goes to the tab named P1

    Any help welcome!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2407 Win 11 Home 64 Bit
    Posts
    24,067

    Re: Assigning action to user form - macros

    What does your form look like? How is a Tab selected. What are the 12 options. More information is needed. Perhaps if you uploaded a sample workbook that is representative of your data it would result in a quick solution
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    04-29-2013
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Assigning action to user form - macros

    The form Capture.JPG

    The tabs are named P1, P2, P3, P4, P5 as per the list shown up to P12.

    Simply I want to be able to select a tab name from the list and when I select "OK" for the spreadsheet to goto the tab name selected.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2407 Win 11 Home 64 Bit
    Posts
    24,067

    Re: Assigning action to user form - macros

    Try this untested code. Attach it to your OK Button. You may have to change the control name combox1 to what ever your control is called. Since you only supplied a picture and not a file (as requested), I could not test nor use your nomenclature.


    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-29-2013
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Assigning action to user form - macros

    Sorry I'm having issues uploading file for some reason, hence the image. When I'm going to attach file it doesn't give me any options just a narrow white box. Believe we have been having internet issues all day.

    I might have to come back to this in the morning.

    Sorry to be a pain.

    ****Follow up! Appears to have attached!
    Attached Files Attached Files

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2407 Win 11 Home 64 Bit
    Posts
    24,067

    Re: Assigning action to user form - macros

    Add a command button to your sheet. Place this code on the button
    Please Login or Register  to view this content.
    Assign this code to your OK button on the form

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-29-2013
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Assigning action to user form - macros

    Many thanks for your help!

    That works perfectly!

+ 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. user form to run macros to populate data in sheet..
    By alwaysneedhelp in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-18-2014, 10:00 AM
  2. using a user created a form in other pc without enabling macros
    By ilayahari in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2014, 03:17 PM
  3. Linking Macros to a Button for designing User Form
    By Logan CMA in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 06-28-2013, 01:03 PM
  4. [SOLVED] Restricting command button action in a user form
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2013, 01:28 AM
  5. Dropdown box on user form to select macros
    By FISMitch in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-29-2013, 09:30 AM
  6. assigning macros to form buttons
    By gibsoneagle05 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-10-2008, 11:38 AM
  7. Assigning cell contents to a textbox in a User Form
    By Jack Gillis in forum Excel General
    Replies: 2
    Last Post: 06-08-2005, 11:05 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