Results 1 to 4 of 4

Thread: Merging And Grouping Rows And Corresponding Data In Table That Meet Specific Criteria

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    20
    Rep Power
    0

    Merging And Grouping Rows And Corresponding Data In Table That Meet Specific Criteria

    Sample workbook attached.

    I have coded a few simple things in VBA so far but not sure how to tackle this one, so code is much appreciated. What I am trying to do is code a way to combine rows in which companies merged. I have a table, MergersTable, with the month, quarter, year, from (company name), to (name) that lists the mergers and when they occurred. In the report, I have the quarter and year listed, and a table (PortfolioTable) with the all company's owned change in value (pre-mergers). I want the script to convert the table to post-mergers change in value.

    So, the code in English:
    For each row in the mergers table, if the quarter matches the specified quarter and the year matches the specified year, add the values in columns 3-9 in PortfolioTable of the position from the from (company name) to the to (company name) for each account that has the merger positions listed in PortfolioTable, then delete the row of the from (company name) row in PortfolioTable.

    If that's not clear, the sample workbook should make better sense. Thanks.

    --

    One more thing. I have a small project coming up that I was going to post on freelancer.com but I want to see if anyone here wants to tackle it (paid) first. Essentially it is exporting text and pivotcharts from excel to word and formatting everything to match a template. I need it to be done within a day or two. I will post the exact project description here tomorrow.
    Attached Files Attached Files

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Can be done. Just to confirm, in the output, the data 2 2013 BBB DDD will have no effect on the output, right?
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Junior Member
    Join Date
    May 2013
    Posts
    20
    Rep Power
    0
    Quote Originally Posted by Excel Fox View Post
    Can be done. Just to confirm, in the output, the data 2 2013 BBB DDD will have no effect on the output, right?
    Correct, since the quarter and year don't match the defined ones, it has no effect.

  4. #4
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Replies: 9
    Last Post: 08-20-2013, 08:45 PM
  2. Replies: 6
    Last Post: 08-14-2013, 04:25 PM
  3. Replies: 4
    Last Post: 05-01-2013, 09:49 PM
  4. Replies: 9
    Last Post: 12-04-2012, 09:45 PM
  5. Merging Data from many workbooks in to one workbook
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 14
    Last Post: 10-10-2011, 11:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •