ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Search range and sort another range (https://www.excelbanter.com/excel-programming/389197-search-range-sort-another-range.html)

John[_130_]

Search range and sort another range
 
I have two columns of data (see below). Is there a way to sort column
B by defining ranges based on column A. I have to sort ItemA, ItemB,
ItemC in column C each time "Color" appears in column A. So, my data
is like this:

Col. A
1 Color
2 Blue
3 Blue
4 Blue
5 Color
6 Red
7 Color
8 Green
9 Green

Col B
1 Item
2 ItemA
3 ItemC
4 ItemB
5 Item
6 ItemA
7 Item
8 ItemB
9 ItemA

I need it to look like this:

Col. A
1 Color
2 Blue
3 Blue
4 Blue
5 Color
6 Red
7 Color
8 Green
9 Green

Col B
1 Item
2 ItemA
3 ItemB
4 ItemC
5 Item
6 ItemA
7 Item
8 ItemA
9 ItemB

Notice Column B is being sorted based on column A. The sort range is
based on finding "Color" in column A---then offsetting by one row and
column.

Sorting updated: B3, B4
Sorting updated: B8, B9

Any help is greatly appreciated!



All times are GMT +1. The time now is 07:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com