title: Excel VBA To Add New Row If Condition Is Met
body: <p>I am attempting to write some VBA that will accomplish</p>
  
  <blockquote>
    <p>if row O is not null then copy all data to new row, then in current row clear columns I, J, K, L, M, N<br>
    in the newly inserted row clear columns O<br></p>
  </blockquote>
  
  <p>The caveat I am not sure to account for is <code>-</code> throws a </p>
  
  <blockquote>
    <p>Type mismatch error</p>
  </blockquote>
  
  <p>Here is the syntax that I am trying to work with</p>
  
  <pre><code>Sub BlueBell()
  Application.ScreenUpdating = False
  Dim i As Long, y
  ReDim y(2 To Range("A" &amp; Rows.Count).End(3).Row)
  For i = UBound(y) To LBound(y) Step -1
  If Cells(i, "O") Then
      If Cells(i, "I") = "" And Cells(i, "K") = "" And Cells(i, "M") = "" Then
          GoTo DoNothing
      Else
          Rows(i).Copy
          Cells(i, "A").Insert
          Range("I" &amp; i &amp; ":J" &amp; i &amp; ":K" &amp; i &amp; ":L" &amp; i &amp; ":M" &amp; i &amp; ":N" &amp; i &amp; ":O" &amp; i + 1).ClearContents
          GoTo DoNothing
      End If
  End If
  DoNothing:
  Next i
  End Sub
  </code></pre>