title: How to compare an array string with a range value
body: <p>I've pulled out unique person's names in a dictionary and then put them into an array:</p>
  <pre><code>'Extract the dictionary's keys as a 1D array
      Dim result As Variant
      result = dic.Keys
  </code></pre>
  <p>That works fine - I can see the unique names in the array called result - Jane, Bob, etc. with: MsgBox Join(result, vbCrLf)</p>
  <p>Its using a loop variable called valCounter2 so I should be able to loop through the array with result(valCounter2)</p>
  <p>Now I'm trying to look for those names in column CX:</p>
  <pre><code>    Dim LSearchRow As Integer
          LSearchRow = 2
          While Len(Range(&quot;A&quot; &amp; CStr(LSearchRow)).Value) &gt; 0
              If Range(&quot;CX&quot; &amp; CStr(LSearchRow)).Value = result(valCounter2) Then
  </code></pre>
  <p>The last line is the problem.  If I set that line to a real value then it works.  So this works:
  <strong>If Range(&quot;CX&quot; &amp; CStr(LSearchRow)).Value = &quot;Jane Smith&quot; Then</strong></p>
  <p>How do I get it to use the array variable?</p>