+ Reply to Thread
Results 1 to 3 of 3

Looping to combine rows based on two elements

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    Vermont, Dakota
    MS-Off Ver
    Excel 2007
    Posts
    22

    Question Looping to combine rows based on two elements

    Hi all!

    I'm trying to modify the following code so that it takes into account not only DATE but also a CODE when grouping entries.

    Currently the code takes data in columns A-E and combines all entries that have the same date in one row and sums related data for each entry in each of the columns. This worked well but now we'd like to add a defining code to the scenario.

    What I'd like the code to do is look to dates in column A and codes in column B and combine all entries with the same date and code into single rows on a new sheet. I have attached an example of what the data looks like and what I'd like to see as an output. People have told me this wouldn't be difficult but given my limited VBA experience I'm having some issues.

    Here is the code I had been using (constructed with help from great users of this forum):
    (There may very well be a better solution to what I'm trying to do! If so I'd love pointers in the right direction.)

    newexample.xlsm

    Please Login or Register  to view this content.
    Last edited by thesteve; 01-16-2014 at 02:04 PM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Looping to combine rows based on two elements

    Out put is on new sheet, created by the code itself.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-25-2013
    Location
    Vermont, Dakota
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Looping to combine rows based on two elements

    wonderful!

+ 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] Help with looping through all elements in Class Array
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2013, 06:47 PM
  2. [SOLVED] formula to combine rows based on empty rows
    By sam_mas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2013, 09:24 AM
  3. [SOLVED] How to combine rows based on value in column A?
    By ClassicVAG in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-03-2012, 06:07 AM
  4. can't combine VBA elements
    By cdn.mark in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2011, 04:16 AM
  5. Looping: Selecting elements from a named range to change calcs
    By Philip J Smith in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-11-2006, 12:25 PM

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