+ Reply to Thread
Results 1 to 5 of 5

Specify a tab from a dropdown list

  1. #1
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Smile Specify a tab from a dropdown list

    Hi

    I'm looking to specify an excel tab from a dropdown list on a form.

    So I have a list of names in a list on a Form in excel. When I select a name. I want that name to be used as Source tab to copy data.
    If I select 'Ground work' on the list. I want the code to copy data from the 'Ground work' tab

    This is what I have got so far.

    BrokerChosen is the name of the list.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Specify a tab from a dropdown list

    Sorry mtillbury, but what then is the question here? Does what you have so far work? I have no idea what to do with this, maybe you can provide a sample book and some more detail? Happy to help, just not sure now yet
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Re: Specify a tab from a dropdown list

    I have no working copy. Sorry, let me explain a bit clearer.
    I have 5 tabs in excel. Called 'Ground', 'Air', 'Sea', 'Land' and a Final tab called 'Main'

    I have a userform with a drop down list. This List has the tab names, So Ground, Air, Sea, Land.

    When I select 'Ground' on the userform dropdown list it sets this as the sheetname So the code know it needs to look at the 'Ground' tab.

    hardcoded would be Set Import = ThisWorkbook.Sheets("Ground")
    but I need the name (bold) to be Dynamic because it could be the following, depending what was selected on the list.
    Set Import = ThisWorkbook.Sheets("Ground")
    Set Import = ThisWorkbook.Sheets("Air")
    Set Import = ThisWorkbook.Sheets("Sea")
    Set Import = ThisWorkbook.Sheets("Land")

    Thats why i was thinking

    Set Import = ThisWorkbook.Sheets("Name selected from list")

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Specify a tab from a dropdown list

    Yeah I agree that should work, but what are you asking us to do/answer/solve? Or just checking that your idea should work fine? I believe the approach should be fine

    EDIT:

    NOTE: I believe you may have to add ".value" when setting the sheets:
    Please Login or Register  to view this content.
    Last edited by Arkadi; 04-23-2015 at 02:30 PM.

  5. #5
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Re: Specify a tab from a dropdown list

    Perfect. Thank you. That was it. I was missing .Value

+ 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. Replies: 0
    Last Post: 08-22-2012, 03:52 PM
  2. Replies: 21
    Last Post: 12-02-2009, 03:27 PM
  3. Date dropdown list and a Time dropdown list in outlook
    By L_ter in forum Outlook Programming / VBA / Macros
    Replies: 3
    Last Post: 03-30-2009, 02:33 AM
  4. result of selecting from the dropdown list should be a dropdown list
    By No News in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-05-2006, 11:15 AM
  5. result of selecting from the dropdown list should be a dropdown list
    By No News in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2006, 05:55 AM

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