+ Reply to Thread
Results 1 to 5 of 5

Need code for macro to pull all data from column heading matching drop-down

  1. #1
    Registered User
    Join Date
    05-02-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Need code for macro to pull all data from column heading matching drop-down

    I have a spreadsheet where I want to specify a month & year (via a drop-down) and pull in all project/phase/mgr/amount data from any cell in the column matching that drop-down that has a value. The data sheet will be constantly changing, so a macro will work better than a pivot or vlookup. I am fairly new to macros & can't make this one work....can anyone help with some code or how to record this? Sample sheet attached. Thanks!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need code for macro to pull all data from column heading matching drop-down

    Hi,

    try this:Billing Plan workbook - Sample.xlsm

    Regards
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    05-02-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Need code for macro to pull all data from column heading matching drop-down

    WOW - this is fantastic! How can I view the code you used to understand it better?
    THANK YOU!!!!

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Need code for macro to pull all data from column heading matching drop-down

    Hi,

    enable the Developer Ribbon: File -> Options -> Customize Ribbon -> Check the checkbox on the right
    go to the developer tab and click the 1st button called "Visual Vasic" to open the VBA project window.
    On the left side in the Project explorer you'll find excel objects listed, i.e each worksheet + one for the workbook and in this case a standard module which contains the code.
    The function in the standard module is called from the "Worksheet_Change" event in the appropriate worksheet module with the selected month value and returns an array of data which is written to the sheet.

    Regards

  5. #5
    Registered User
    Join Date
    05-02-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Need code for macro to pull all data from column heading matching drop-down

    Thanks VERY much!

+ 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