Hi Everyone,
Long time reader, first time poster here! Have been struggling to work out the following, not having much success. I have multiple worksheets with hundreds of rows that have been categorised with section headers at various rows, similar to first sample below.
What I am trying to achieve is to copy these "categories" into the first column in front of the rows until it gets to the next category then copy that category in front of the next lot of rows so tha ti turns out like the second example. I then just plan to delete these original rows with the category names using a filter for blank rows in in column C.
Any help would be greatly appreciated!
Trying to go from this....
to this by using a VBA macro
Long time reader, first time poster here! Have been struggling to work out the following, not having much success. I have multiple worksheets with hundreds of rows that have been categorised with section headers at various rows, similar to first sample below.
What I am trying to achieve is to copy these "categories" into the first column in front of the rows until it gets to the next category then copy that category in front of the next lot of rows so tha ti turns out like the second example. I then just plan to delete these original rows with the category names using a filter for blank rows in in column C.
Any help would be greatly appreciated!
Trying to go from this....
Book1 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | GroupOne | ||||||||||
2 | 1/06/2019 | East | Jones | Pencil | 95 | 1.99 | 189.05 | ||||
3 | 5/22/2019 | West | Thompson | Pencil | 32 | 1.99 | 63.68 | ||||
4 | 6/08/2019 | East | Jones | Binder | 60 | 8.99 | 539.4 | ||||
5 | 6/25/2019 | Central | Morgan | Pencil | 90 | 4.99 | 449.1 | ||||
6 | GroupTwo | ||||||||||
7 | 7/12/2019 | East | Howard | Binder | 29 | 1.99 | 57.71 | ||||
8 | 7/29/2019 | East | Parent | Binder | 81 | 19.99 | 1,619.19 | ||||
9 | 8/15/2019 | East | Jones | Pencil | 35 | 4.99 | 174.65 | ||||
10 | 9/01/2019 | Central | Smith | Desk | 2 | 125 | 250 | ||||
11 | 9/18/2019 | East | Jones | Pen Set | 16 | 15.99 | 255.84 | ||||
12 | 10/05/2019 | Central | Morgan | Binder | 28 | 8.99 | 251.72 | ||||
13 | 10/22/2019 | East | Jones | Pen | 64 | 8.99 | 575.36 | ||||
14 | GroupThree | ||||||||||
15 | 11/08/2019 | East | Parent | Pen | 15 | 19.99 | 299.85 | ||||
16 | 11/25/2019 | Central | Kivell | Pen Set | 96 | 4.99 | 479.04 | ||||
17 | 12/12/2019 | Central | Smith | Pencil | 67 | 1.29 | 86.43 | ||||
18 | 12/29/2019 | East | Parent | Pen Set | 74 | 15.99 | 1,183.26 | ||||
19 | 1/15/2020 | Central | Gill | Binder | 46 | 8.99 | 413.54 | ||||
20 | 2/01/2020 | Central | Smith | Binder | 87 | 15 | 1,305.00 | ||||
21 | |||||||||||
22 | |||||||||||
Sheet1 |
to this by using a VBA macro
Book1 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | GroupOne | |||||||||
2 | GroupOne | 1/06/2019 | East | Jones | Pencil | 95 | 1.99 | 189.05 | ||
3 | GroupOne | 5/22/2019 | West | Thompson | Pencil | 32 | 1.99 | 63.68 | ||
4 | GroupOne | 6/08/2019 | East | Jones | Binder | 60 | 8.99 | 539.4 | ||
5 | GroupOne | 6/25/2019 | Central | Morgan | Pencil | 90 | 4.99 | 449.1 | ||
6 | GroupTwo | |||||||||
7 | GroupTwo | 7/12/2019 | East | Howard | Binder | 29 | 1.99 | 57.71 | ||
8 | GroupTwo | 7/29/2019 | East | Parent | Binder | 81 | 19.99 | 1,619.19 | ||
9 | GroupTwo | 8/15/2019 | East | Jones | Pencil | 35 | 4.99 | 174.65 | ||
10 | GroupTwo | 9/01/2019 | Central | Smith | Desk | 2 | 125 | 250 | ||
11 | GroupTwo | 9/18/2019 | East | Jones | Pen Set | 16 | 15.99 | 255.84 | ||
12 | GroupTwo | 10/05/2019 | Central | Morgan | Binder | 28 | 8.99 | 251.72 | ||
13 | GroupTwo | 10/22/2019 | East | Jones | Pen | 64 | 8.99 | 575.36 | ||
14 | GroupThree | |||||||||
15 | GroupThree | 11/08/2019 | East | Parent | Pen | 15 | 19.99 | 299.85 | ||
16 | GroupThree | 11/25/2019 | Central | Kivell | Pen Set | 96 | 4.99 | 479.04 | ||
17 | GroupThree | 12/12/2019 | Central | Smith | Pencil | 67 | 1.29 | 86.43 | ||
18 | GroupThree | 12/29/2019 | East | Parent | Pen Set | 74 | 15.99 | 1,183.26 | ||
19 | GroupThree | 1/15/2020 | Central | Gill | Binder | 46 | 8.99 | 413.54 | ||
20 | GroupThree | 2/01/2020 | Central | Smith | Binder | 87 | 15 | 1,305.00 | ||
21 | ||||||||||
Sheet1 |