title: How to keep a cell value updated while the spreadsheet is in use
body: <p>I just started on VBA and i am facing some problems while coding.</p>
  
  <p>I am developing a solution to be used with RPA, and for this to work i need to a fixed cell in an spreadsheet to keep the cell location value retrieved by the function below: </p>
  
  <pre><code>Function FindCell()
  Dim CellLocation As Range
  Set CellLocation = Sheets("Data").Range("A:A").Find("OBRC", LookIn:=xlValues) 'Returns the cell in which OBRC is found
  </code></pre>
  
  <p>And to this function fulfill my needs, i implemented the second part of the code where my function write the value retrieved in the cell P3: </p>
  
  <pre><code>Function FindCell()
  Dim CellLocation As Range
  Set CellLocation = Sheets("Data").Range("A:A").Find("OBRC", LookIn:=xlValues) 'Returns the cell in which OBRC is found
  
  
  While ActiveSheet.Name = "Data"
  
      With ThisWorkbook.Sheets("Data").Range("P3").Value = FindCell.Value
  
  
  End With
  Wend
  
  
  End Function
  </code></pre>
  
  <p>But everytime i try to call this function i got the error </p>
  
  <blockquote>
    <p>Run-Time error 424: Object required</p>
  </blockquote>