title: VBA for Excel throws "Object variable or with block variable not set" when there is no Object
body: <p>In my code, I have declared these variables:</p>
  
  <pre><code>Dim Field_Name, Datatype, row As Integer
  </code></pre>
  
  <p>Then, inside a For loop, I have this code:</p>
  
  <pre><code>Field_Name = Worksheets(i).UsedRange.Find("Field Name").Column
  Datatype = Worksheets(i).UsedRange.Find("Datatype").Column
  row = Worksheets(i).UsedRange.Find("Field Name").row + 1
  </code></pre>
  
  <p>However, that code throws the "Object variable or with block variable not set" run-time error. According to the API, the Range.Column and Range.row property is a read-only Long. I have tried making the datatype of my variables to Long, but with no success. It would appear that VBA expecting me to do</p>
  
  <pre><code>Set Field_Name = Worksheets(i).UsedRange.Find("Field Name").Column
  Set Datatype = Worksheets(i).UsedRange.Find("Datatype").Column
  Set row = Worksheets(i).UsedRange.Find("Field Name").row + 1
  </code></pre>
  
  <p>However, said variables are not objects, so doing that throws the "Object required" compile error.</p>
  
  <p>Any help with this would be greatly appreciated. If you're not sure about how to fix it, then any workarounds or alternative ways to get the column number and row number of a cell would be greatly appreciated.</p>