title: Count Rows Until Finding Specific String
body: <p>I am trying to use Excel VBA to count the number of rows until I hit a specific string and set a variable equal to it.</p>
  
  <p>Something like:</p>
  
  <pre><code>Dim i as Integer
  
  i = Worksheets("Scope Phase Document").Range("A1", Range("A1").End(xlDown)).Find("FACTS - What are we measuring?").Count
  </code></pre>
  
  <p>I know this isn't the correct syntax and I'm probably missing other stuff, but just using the different functions I currently know, this is what I would hope would do the trick.  I get </p>
  
  <blockquote>
    <p>Run-time error '91' saying "Object variable or With block variable not
    set</p>
  </blockquote>
  
  <p>I have tried a few different ways of doing it, but can't figure out a way that doesn't result in an error.</p>
  
  <p>So I want to start at A1 and count all the rows down until I reach the specific string "FACTS - What are we measuring?".</p>
  
  <p>Any help would be greatly appreciated!</p>