title: "No Cells Found Error" in Excel vba
body: <p>I am using following code to unMerge and copy the cells. This is the code i am using.</p>
  
  <pre><code>Sub unMerge()
      Dim lastRow As Long
      Dim lastCol As Long
      lastRow = Range("B2").End(xlDown).Row
      lastCol = Range("A2").End(xlToRight).Column
  
      For iCol = 1 To lastCol
  
          Columns(iCol).unMerge
          Columns(iCol).SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=r[-1]c"
  
      Next iCol
  End Sub
  </code></pre>
  
  <p>The code works smoothly when there are merged cells in the column however when a column is encountered without merged cells it give the Captioned Error.
  What could be the fault in the code.</p>