VBA code to sort by list and then delete simliar rows only in one column

jassybunny

New Member
Joined
Jun 27, 2012
Messages
2
I have a spreadsheet that gets data from another source, and the rows change, the columns do not (there are columns A:X). I need the Column B to merge if the text is the same in column B. The rows must be sorted by the area (a custom list OR array?). Here is an example:

Raw Data:
Col A***Col B******Col C Etc.
0100***AreaOrange
0103***AreaOrange
0105***AreaOrange
0108***AreaPurple
0121***AreaPurple
0147***AreaPurple
B124***AreaPink
B127***AreaPink
0136***AreaOrange

should look like

Col A*****Col B******Col C Etc.
0100*****AreaOrange
0103*****
0105*****
0136*****
0108*****AreaPurple
0121*****
0147*****
B124*****AreaPink
B127*****

I have pretty limited experience with VBA/Excel, and any help would greatly be appreciated. They are not to be sorted alphabetically, but rather by the area itself. Some days not all areas will be used (therefore not on the data list, but still needs to be on the worksheet) and those should say the word "Out" instead of being blank. If attaching the data to the thread helps, let me know. This is what I am thinking:
so perhaps a nested IF
Array of Areas
if area = areaorange, sort row
if area = areapurple, sort row

if area = area in same column, delete row underneath

something like that? please help! thank you!
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Watch MrExcel Video

Forum statistics

Threads
1,123,271
Messages
5,600,651
Members
414,399
Latest member
Ninjee

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
Top