use cell value specific characters as variable header

dbq

New Member
Joined
Jan 21, 2011
Messages
11
I have a worksheet that has 2 columns of information (simplified version).

Column A has a non-sorted, nonlinear, list of part numbers, descriptions and some empty cells.
It is divided into variable row sections by “header” characters. These characters are [1], [2], [3], etc. UP TO [20] (with the brackets)

Column B has the associated quantities of each part.

I would like a macro that will set up columns C,D,E,F,G,H,I,J,K,L so that I can move the part quantities under rows below [1] and above [2] to column C,part quantities under rows below [2] and above [3] to column D, and so on.

When complete, all quantities will be in the same row they originated in, but would shift to the column associated with the “header” character. ( Section [1] quantities in column C., Section [2] quantities in column D.,etc.)

source looks like:

ABCD
[1]
part numberquantity
32147895

<tbody>
</tbody>
25
45678451

<tbody>
</tbody>
2
5264258

<tbody>
</tbody>
54
12333546

<tbody>
</tbody>
78
discount1
[2]
5687945

<tbody>
</tbody>
21
34688154

<tbody>
</tbody>
5
3254687

<tbody>
</tbody>
85
[3]
3245678

<tbody>
</tbody>
4
4568795

<tbody>
</tbody>
75
1645987

<tbody>
</tbody>
35
[4]
8461354

<tbody>
</tbody>
11
23465879

<tbody>
</tbody>
2
1648795

<tbody>
</tbody>
74

<tbody>
</tbody>

resulting worksheet


A
BCDEFGHIJKL
[1]
part numberquantity
321478952525
4567845122
52642585454
123335467878
discount1
[2]
56879452121
3468815455
32546878585
[3]
324567844
45687957575
16459873535
[4]
84613541111
2346587922
16487957474

<tbody>
</tbody>
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,220,980
Messages
6,157,185
Members
451,404
Latest member
Probe

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