title: Fill column based on the values of another one in a dynamic range and merge lines at the end for the cells within the same cable tag
body: <p>I'm trying to fill a column with color abreviations based on number of times a text appears on another column.
  In the next image you can see that I have in the column C, starting at line 5 a cable tag, in this case this cable tag appears 2 times, so i need to fill the column E (lines 5 and 6) with 2 colors abreviations that are present in column J.
  In this first case the column E line 5 will be equal to 1/BL and the line 6 will equal to 1/RD.
  After this I need to go to the next cell that have another cable tag, in this case line 21, count how many times the cable tag appears and then fill the column E with the color abreviation, allways starting from the beginning of the colors abreviations.
  After this go to the next cable tag and so on....</p>
  <p><a href="https://i.stack.imgur.com/Y3MbU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y3MbU.png" alt="Excel Terminals" /></a></p>
  <p>The values on column C are populated by excel formulas, the range and number of cable tags  will be different every time.
  Next image shows another example</p>
  <p><a href="https://i.stack.imgur.com/3yE57.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3yE57.png" alt="enter image description here" /></a></p>
  <p>In this case the cable tag E/H72011 appears 10 times, so i need to fill the column E lines 19 to 28 with the colors abreviations, starting with 1/BL to 2/RD</p>
  <p>After this I need to copy this entire sheet to a new one to remove the formulas and leave only the values and then merge the cells with the same value.
  The end result is shown on the next image</p>
  <p><a href="https://i.stack.imgur.com/rjJsp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rjJsp.png" alt="enter image description here" /></a></p>
  <p>Is it possible to do this?
  Thank you.</p>