+ Reply to Thread
Results 1 to 10 of 10

Use VBA to populate Range based on Dropdown date selection

  1. #1
    Registered User
    Join Date
    01-23-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    81

    Use VBA to populate Range based on Dropdown date selection

    Hi,
    I have 2 problems I am trying to solve and unsure where to begin. I will describe them;

    1. I have a spread sheet with a date drop down box on an output sheet and some raw monthly data in another. I would like to select the date in the drop down and pull the corresponding data from the data sheet into the appropriate cell in the output sheet for the monthly data.

    2. The second is I have a YTD box I would like to fill based on all previous values from that current year. (I can figure the correct math out if you just help me add them for now)


    I attached a sample workbook to help figure it out what I mean. The help is appreciated.

    ExcelSheet.xlsm

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Use VBA to populate Range based on Dropdown date selection

    When a date is selected,
    you want to copy the complete set of data corresponding to a date in sheet "RawData" and paste it in the range "B8:H23" in sheet "Output Sheet" .
    Is it?
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    01-23-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Use VBA to populate Range based on Dropdown date selection

    That is correct. I was attempting to do it with named ranges but could not figure it out.

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Use VBA to populate Range based on Dropdown date selection

    See how the file attached can help.
    Concerning the YTD I don't know what to do
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-23-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Use VBA to populate Range based on Dropdown date selection

    That will help a ton! Thanks PCI

  6. #6
    Registered User
    Join Date
    01-23-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Use VBA to populate Range based on Dropdown date selection

    Could you help me out a bit by explaining the lines of code? Just trying to understand what is happening, thanks again.

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Use VBA to populate Range based on Dropdown date selection

    I will have a look and will answer you, but not immediately

  8. #8
    Registered User
    Join Date
    01-23-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Use VBA to populate Range based on Dropdown date selection

    Not a problem, I am in no rush. Just trying to learn more about VBA and the steps of what does what.

  9. #9
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Use VBA to populate Range based on Dropdown date selection

    Here we are
    Please Login or Register  to view this content.
    by the way :
    - The date in the ComboBox or in sheet RawData could be prepared with same format
    - In the code attached cell B4 is updated with ComboBox date value
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-23-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    81

    Re: Use VBA to populate Range based on Dropdown date selection

    Thanks PCI I appreciate it!

+ 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] Populate column based on selection from a dropdown
    By dbwaste04 in forum Excel General
    Replies: 5
    Last Post: 11-01-2014, 04:23 PM
  2. [SOLVED] Populate cells based on date and time range selection
    By garyfahy in forum Excel General
    Replies: 3
    Last Post: 03-10-2014, 08:43 AM
  3. Replies: 6
    Last Post: 05-31-2013, 11:17 AM
  4. [SOLVED] Auto populate dates of a month based on dropdown selection
    By tstruntz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2012, 10:10 AM
  5. Auto-populate fields based on selection from dropdown?
    By Aswert in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-20-2009, 03:26 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