title: Adding a populated row using Macro Statement
body: <p>This is the statement I am currently using.  I need to find a way to populate the two rows I've inserted, using the value of the last populated cell before my new empty rows.  How do I do this?</p>
  
  <pre><code>Sub Insert_Rows()
  Dim r As Long, mcol As String, i As Long, s As Long, ncol As Long
  
  ' find last used cell in Column A
    r = Cells(Rows.Count, "A").End(xlUp).Row
  
   ' get value of  last used cell in column A
    mcol = Cells(r, 1).Value
  
  'find last used cell in Column B
   s = Cells(Rows.Count, "B").End(xlUp).Row
  
    ' get value of last used cell in Column B
    ncol = Cells(s, 1).Value
  
   ' insert rows by looping from bottom
    For i = r To 2 Step -1
       If Cells(i, 1).Value &lt;&gt; mcol Then
         mcol = Cells(i, 1).Value
          Rows(i + 1).Insert
      Rows(i + 1).Insert
       End If
    Next i
  End Sub
  </code></pre>