title: Inserting rows and move/pull data from a horizontal layout to a vertical layout
body: <p>I have a table of data such that specific columns of the information needs to be converted from a horizontal layout and inserted below the initial row. To Make things more complex any column with a value of zero needs to be ignored and each row may have a different column with a zero. </p>
  
  <p>I have gotten as far as inserting rows for the total count of columns with a value greater than 0 by using a countif formula in column "Q" for this vba.</p>
  
  <pre><code>Sub H2V()
  ' H2V Macro
  ' Integrate vertical UB-04 codes
      Worksheets("Sheet1 (2)").Activate
  
      Dim r, count As Range
      Dim LastRow As Long
      Dim temp As Integer
  
      Set r = Range("A:P")
      Set count = Range("Q:Q")
      LastRow = Range("B" &amp; Rows.count).End(xlUp).Row
  
      For n = LastRow To 1 Step -1
          temp = Range("Q" &amp; n)
  
          If (temp &gt; 1) Then
              Rows(n + 1 &amp; ":" &amp; n + temp).Insert Shift:=xlDown
          End If
  
      Next n
  
  End Sub
  </code></pre>
  
  <p>But I cannot for the life of me figure out how to pull the data from the horizontal set into the newly created rows to make it vertically integrated. </p>
  
  <p>Revised Example (more complete):
  <a href="https://i.stack.imgur.com/SegQM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SegQM.png" alt="Original Data Set"></a></p>
  
  <p><a href="https://i.stack.imgur.com/VL17b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VL17b.png" alt="Post VBA Run"></a></p>
  
  <p><a href="https://i.stack.imgur.com/GWHXE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GWHXE.png" alt="Macro Used"></a></p>