+ Reply to Thread
Results 1 to 12 of 12

Prompt user to select worksheet

  1. #1
    Registered User
    Join Date
    02-18-2013
    Location
    Germantown, MD
    MS-Off Ver
    Excel 2007
    Posts
    12

    Prompt user to select worksheet

    Hello all!

    I'm a newbie and need some help in Excel 2007. I'm not very familiar with macros or VBA, but I definitely know how to copy and paste code

    I have a workbook with 6 worksheets: "Repair work in DC", "Repair work in MD", "Repair work in VA", "Construction in DC", "Construction in MD" and "Construction in VA". I would like the user to be prompted to select what type of work (repair or construction) and then which state (DC, MD or VA) so that the correct worksheet is displayed. If that's not an option (or too complicated to explain), then I just want all of the worksheets hidden when the file is opened and then prompt the user to select the correct worksheet (1 out of the 6 I previously listed).

    I know this is probably very basic for many of you but I could really use the help!!

    Thanks in advance for your time!!

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Prompt user to select worksheet

    You will need to have a user form, which opens in the Workbook_Open event of the Workbook, this will then ask teh questions.

    I presume from the question, you will have 2 questions, Which type of Work "Repair" or "Constructions" and then in what state, with answers "DC","MD" or "VA", then a button to click, which builds the worksheet name off this.

    I have attached a demo
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-18-2013
    Location
    Germantown, MD
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Prompt user to select worksheet

    This is great, thank you so much!

    Now I'm assuming I need to enter some coding, whether a macro or in VBA? Or is it just as simple as inserting a user form with the questions? Sorry....like I said before, I'm not good with this stuff!

  4. #4
    Registered User
    Join Date
    02-18-2013
    Location
    Germantown, MD
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Prompt user to select worksheet

    Oh, nevermind, I see where you put the coding in. I'll give it a try....thanks!!

  5. #5
    Registered User
    Join Date
    02-18-2013
    Location
    Germantown, MD
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Prompt user to select worksheet

    Ok, I'm going to throw in a monkey wrench. I would like all of my worksheets hidden when the file is opened, so the user HAS to make his selection before he can even see the worksheet that he chooses. Can you help me with that?

    DISREGARD THE ATTACHMENT.....I FIGURED OUT WHAT MY PROBLEM WAS.
    Attached Images Attached Images
    Last edited by darkangl640; 02-18-2013 at 12:33 PM. Reason: DISREGARD ATTACHMENT

  6. #6
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Prompt user to select worksheet

    try this to see if its what you want.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Prompt user to select worksheet

    If you dont want all sheets to be visible after the user selects the sheet they need (and just unhide the sheet they are after) change the code to the following:

    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Prompt user to select worksheet

    If you dont want all sheets to be visible after the user selects the sheet they need (and just unhide the sheet they are after) change the code to the following:

    Please Login or Register  to view this content.
    OOPS duplicate post for some reason...mods please delete this one.
    Last edited by nickmax1; 02-18-2013 at 12:50 PM. Reason: duplicate

  9. #9
    Registered User
    Join Date
    02-18-2013
    Location
    Germantown, MD
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Prompt user to select worksheet

    That is absolutely perfect and the 2nd code was EXACTLY what I needed! Thanks again for your quick reply!!!

  10. #10
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Prompt user to select worksheet

    glad to help.

    please mark this thread as solved if you are happy.

  11. #11
    Registered User
    Join Date
    02-18-2013
    Location
    Germantown, MD
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Prompt user to select worksheet

    Sorry, one last question (I hope). Is there a way to rename "CommandButton1" button to something else? Like "Go to selected worksheet", or simply "Go To"?

  12. #12
    Registered User
    Join Date
    02-18-2013
    Location
    Germantown, MD
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Prompt user to select worksheet

    Nevermind....found it!! I will mark as solved. Thanks!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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