title: If Cell is Empty Copy Cell Above
body: <pre><code>Sub MacroFillAreas()
  
      For Each area In Columns("B:C").SpecialCells(xlCellTypeBlanks)
          If area.Cells.Row &lt;= ActiveSheet.UsedRange.Rows.Count Then
              area.Cells = Range(area.Address).Offset(-1, 0).Value
          End If
      Next area
  End Sub
  </code></pre>
  
  <p>This is my macro for filling blank cells in my workbook. I am throwing an object error on <code>area.Cells = Range(area.Address).Offset(-1, 0).Value</code></p>
  
  <p>Can anyone explain why this happens? Here is a quick example of the data and what I am trying to do with it.</p>
  
  <pre><code>A  1  12
  A  1  12
  A  
  A  
  A  2  14
  A  
  A  3  14
  A
  A
  </code></pre>
  
  <p>That has to copy down the cells above:</p>
  
  <pre><code>A  1  12 
  A  1  12
  A  1  12
  A  1  12
  A  2  14
  A  2  14
  A  3  14
  A  3  14
  A  3  14
  </code></pre>