Macro for Grouping Rows

ShanaVT

Board Regular
Joined
May 12, 2010
Messages
86
Hello! I have about 10,000 rows of data that I need grouped based on certain criteria and I am trying to figure out a way to group them without doing it manually. Below is the sample data and the groupings I am trying to achieve. Any help is much appreciated! Thanks!!!

Total Data
CRN_111111 ABC Program
CRN_222222 DEF Program
CRN_333333 GHI Program
862_0069_0004 Alpha Programs - Group 1
CRN_444444 JKL Program
CRN_555555 MNO Program
862_0069_0001 Alpha Programs - Group 2
CRN_666666 PQR Program
862_0069_0058 Alpha Programs - Group 3
862_0069 Alpha Programs
CRN_111111 ABC Program
CRN_222222 DEF Program
CRN_333333 GHI Program
862_0070_0006 Beta Programs - Group 1
CRN_444444 JKL Program
CRN_555555 MNO Program
862_0070_0020 Beta Programs - Group 2
CRN_666666 PQR Program
862_0070_0058 Beta Programs - Group 3

862_0070 Beta Programs
862 Contracts

Level 1 Grouping:
862 Contracts

Level 2 Grouping
862_0069 Alpha Programs
862_0070 Beta Programs
862 Contracts

<tbody>
</tbody>

Level 3 Grouping
862_0069_0004 Alpha Programs - Group 1
862_0069_0001 Alpha Programs - Group 2
862_0069_0058 Alpha Programs - Group 3
862_0069 Alpha Programs
862_0070_0006 Beta Programs - Group 1
862_0070_0020 Beta Programs - Group 2
862_0070_0058 Beta Programs - Group 3
862_0070 Beta Programs

<tbody>
</tbody>
862 Contracts

<tbody>
</tbody>
 
Last edited:

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,215,131
Messages
6,123,222
Members
449,091
Latest member
jeremy_bp001

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