Excel VBA to cut and paste rows below headers based on text in another cell

14 Views Asked by At

I am trying to write VBA code to select a row then cut it based on text string "CBL" in col I and paste it under the corresponding header, CABLE RACK AND IRONWORK MATERIAL, selecting row 22 (or maybe a better way to select where to paste the row) to insert the cut row, then doing it again for the next row containing "CBL", pasting it under the previous row and continue doing this until there are no more cells in Col I. Once complete for cells with text "CBL", I would like to do the same for rows in I containing "FIBER", pasting those rows under the header FIBER MANAGMENT MATERIAL and continue for each until all rows show up under the proper headers.

enter image description here

I have included what I've tried so far. The previous version of this did the first row but will not loop until complete. I mad a change and have broken it since. I included a snippet of the result I'm looking for. I am new to this and appreciate the help.

enter image description here

enter image description here

0

There are 0 best solutions below