title: Simple Excel VB Cell value change - Error #1004: Application-defind or object-defined error
body: <p>i've been trying to fix this error for hours now and i can't seem to see what it is that i am doing wrong here.</p>
  
  <p>My macro is as it follows:</p>
  
  <pre><code>Function testValueChange(cell As Range)
      On Error GoTo ErrorHandler
  
      Dim testValue As String
  
      testValue = Range(cell.Address)
  
      MsgBox testValue
  
      Range("Q2") = "new value"
  Exit Function
  
      ErrorHandler:
          MsgBox "Error #" &amp; Err &amp; " : " &amp; Error(Err)
  End Function
  </code></pre>
  
  <p>I am able to retrieve the "testValue" correctly and it is displayed on the MsgBox. However, when i try to set a new value to the cell "Q2", i get the error "Error #1004: Application-defined or object-defined error."</p>
  
  <p>There are several entries for that error over the web but none of them in this situation when i'm trying to simply set a String value to an empty cell!</p>
  
  <p>The cell "Q2" is empty, i've chosen that cell specifically because it is not merged, nor referenced on another function or anything.</p>
  
  <p>Thanks in advance for all the help!</p>