title: Getting error message on below VBA to get reference of a cell along with formatting
body: <pre><code>Private Sub Worksheet_Change(ByVal Target As Excel.Range)
   With Worksheets("Sheet1")
      If .Range("A1").Value2 &lt;&gt; "" Then
          On Error Resume Next
          Range("A1").Copy (.Range("E2"))
      End If
   End With
  End Sub
  </code></pre>