+ Reply to Thread
Results 1 to 5 of 5

Get Data via drop down list

  1. #1
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Get Data via drop down list

    Hi guys

    I have previously used a get data macro to go and return figures from different spreadsheets to collate in one place. And now I would like to use this again, but in a different way.

    Basically, When I hit the button to get the data, It will first look at the dropdown list, and see what day is selected, and return figures for that day only.

    Here is what i currently have:

    Please Login or Register  to view this content.

    This example would be for saturday, so if the dropdown list said "monday" then it will go off and get mondays figures.
    I think this would mean a massive list as our days are actually split into day & Night so there would be 14 scenarios.

    I'm guessing, it would have to be an IF or an ELSE between each set list??? Then the whole list repeated again?????? but I can't remember how to correctly put the IF or ELSE together for this?

    Dropdown list list would contain:

    Sat Night
    Sun Day
    Sun Night
    Mon Day
    Mon Night
    Tues Day
    and so on until Sat Day



    Many Thanks

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Get Data via drop down list

    You macro is feeding text strings into your function that it is using to construct accurate formulas. So you should be able to declare a variable to store the sheet name you've selected, then feed that into your text string lists.

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Get Data via drop down list

    Quote Originally Posted by JBeaucaire View Post
    You macro is feeding text strings into your function that it is using to construct accurate formulas. So you should be able to declare a variable to store the sheet name you've selected, then feed that into your text string lists.

    Please Login or Register  to view this content.

    Wow! I'll be trying this out within the next couple of days! Thought it was going to be more complicated than that!

    Thanks

  4. #4
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: Get Data via drop down list

    Quote Originally Posted by JBeaucaire View Post
    You macro is feeding text strings into your function that it is using to construct accurate formulas. So you should be able to declare a variable to store the sheet name you've selected, then feed that into your text string lists.

    Please Login or Register  to view this content.

    Actually, I just realised, there will be a new type of sheet to take the data from for half of this, so the sheet name will always be the same, but the column will change.
    E.G Monday is A1 Tuesday is B1. Wednesday is C1 and so on.

    So if the drop down said Tuesday, somehow, it needs to know to shuffle over one?

    But at the same time as writing this, I am wondering, if I had a lookup hidden elsewhere in the sheet, Monday =A1 Tuesday =B1 then I can use the same method to use the lookup answer for my cell location??

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Get Data via drop down list

    Yes, you should be able to construct a table that associates text strings with other values. Then do a VLOOKUP on the value in your drop down selection cell.

    http://screencast.com/t/ZLust5rhDxSf

+ 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. Drop down list leading to data in a further drop down list
    By Torchdesign in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 01-27-2014, 10:36 AM
  2. Replies: 1
    Last Post: 09-05-2012, 11:39 AM
  3. Replies: 3
    Last Post: 04-16-2012, 10:14 PM
  4. Replies: 1
    Last Post: 03-08-2012, 05:02 PM
  5. Replies: 6
    Last Post: 10-23-2011, 03:25 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