Macro - sorting by a specific word

Status
Not open for further replies.

ApolloID

Well-known Member
Joined
Jun 8, 2010
Messages
769
Hi,

I have the below table and i need a macro to sort by specific words in column "D", words that are part of a group, then to add the name of the group in column B. And after each group to make a total for that group's value and qty.
The table starts from A5.

SupplierGroupCodDescriptionValueQty
supplier 1s 228scissor 13,781.191,614.00
supplier 2t 141tweezer 822,187.251,958.00
supplier 2t 222tweezer 1015,515.334,184.00
supplier 1s 259scissor 898,214.133,435.00
supplier 1s 235cuticle scissor 331,989.64775.00
supplier 2t389oblique tweezer 162,989.121,312.00

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

This is how i need the table to be:
SupplierGroupCodDescriptionValueQty
supplier 1scissors 228scissor 13,781.191,614.00
supplier 1scissors 259scissor 898,214.133,435.00
supplier 1scissors 235cuticle scissor 331,989.64775.00
scissor total13,984.965,824.00
supplier 2tweezert 141tweezer 822,187.251,958.00
supplier 2tweezert 222tweezer 1015,515.334,184.00
supplier 2tweezert389oblique tweezer 162,989.121,312.00
tweezer total10,691.707,454.00

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

I need to make groups inside the macro with products that will be part of that group. The words could be at the begining or as part of the product name.
Also, it would be great to put all unidentified products to an "Unknown" group at the end of all sorted groups.

Can this be done?
Thank you in advance,

Apollo.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Status
Not open for further replies.

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