Help Creating a simple Macro Combining rows based on determining factors

mnty89

Board Regular
Joined
Apr 1, 2016
Messages
66
Ok so some quick random sample data below for the scenario.

So basically I need to do the following per Account(column A)


Each account will have a Department- column C. I need to create a single row for each Department within each Account that combines the values on Columns F-K, the dates. They are divided into two rows based on the option fields for whether they go into one or another, but I basically need them to just skip the blanks, ignore the options and just put all of the values per department into a single row. I put an after version of what I'm hoping for below the original sample as well to illustrate it better than I can explain. I feel like this is very simple, but I'm not sure how to approach it.

Any help is amazing! Thank you!



Original:

Account NameAccount codeDepartmentOption AOption BJanuaryFebruaryMarchAprilMayJune
Account 1 1234561A 102417193413
Account 1 1234562A21 452213
Account 1 1234562 B 3544
Account 22345671A 4249
Account 22345671B3325 4322
Account 22345672A 264844 12
Account 22345672 B26 24
Account 33456781A 36 39
Account 33456781B35 3618 19
Account 33456782A142610
Account 33456782 B 442511

<colgroup><col><col><col><col span="8"></colgroup><tbody>
</tbody>

End Result:

Account NameAccount codeDepartmentOption AOption BJanuaryFebruaryMarchAprilMayJune
Account 1 1234561191823421228
Account 1 1234562351124492318
Account 22345671393432303325
Account 22345672322523343447
Account 33456781283645384918
Account 33456782114949262642

<colgroup><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,215,219
Messages
6,123,687
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top