title: If cell A1 is greater than B1, cut and paste row to first empty row
body: <p>If cell in column I1-I14 is greater than cell in column J1-J14, I want to cut the entire row and paste values to the first empty row. (From row 16 and down.)</p>
  <p>If cell i is greater than cell j, cut row and paste values to first empty row (row 16 in this example)<br />
  <a href="https://i.stack.imgur.com/5XIvT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5XIvT.png" alt="enter image description here" /></a></p>
  <p>This code just pastes in the first row:</p>
  <pre class="lang-vb prettyprint-override"><code>Sub Knapp6_Klicka()
      
      Dim i As Long
      Dim j As Long
      
      j = 1
      For i = 3 To 500
          If Cells(i, 9).Value &gt; Cells(i, 10).Value Then
              Cells(i, 12).EntireRow.Cut Sheets(&quot;Blad1&quot;).Range(&quot;A&quot; &amp; j)
          j = j + 1
          End If
      Next i
          
  End Sub
  </code></pre>
  <p>I tried to combine the paste with two different solutions.</p>
  <p>One like this, where I recorded a macro and went to the last cell, then up to the first empty cell:</p>
  <pre class="lang-vb prettyprint-override"><code>Range(&quot;A1048576&quot;).Select
  Selection.End(xlUp).Select
  ActiveCell.Offset(1, 0).Range(&quot;A1&quot;).Select
  Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
  Application.CutCopyMode = False
  </code></pre>
  <p>And one solution that I found on an Excel community:</p>
  <pre class="lang-vb prettyprint-override"><code>Sub compareresult()
      
      Dim row1 As Integer
      Dim row2 As Integer
      
      row2 = 1
      For row1 = 8 To 500
          If sheet1.Cells(row1, 11).value &gt; sheet1.Cells(row1, 9).value Then
              sheet1.Cells(row1, 1).EntireRow.Copy Sheets(11).Cells(row2, 1)
              row2 = row2 + 1
          End If
      Next row1
      
  End Sub
  </code></pre>