I have a project to create a macro in Excel. I have attached a file with two sheets that contains examples of what I am after. In Sheet1 I have the dates, codes, descriptions and amounts of certain transactions. The data in Sheet1 contains multiple listings of the same code on the same day, with different amounts for each row. The macro needs to consolidate this data into Sheet2. The macro should consolidate the data if there is a repeat of the same code on the same day, and sum the debit and credit amounts for this code into a single row. This way Sheet2 contains a single row for each different transaction code on each day, but only one row for each different transaction code for each day. Can the macro please be done using a loop as the row lengths will get quite large and will be variable, thanks for your help!