title: Compile error: expected list separator vba
body: <p>I am having a compile error when running a vba macro. The error is on line:</p>
  
  <pre><code> If inStr(";" &amp; Trim(str(r)) &amp; ";") &lt; 1 Then
  </code></pre>
  
  <p>variables:</p>
  
  <pre><code> Dim str() As String 'string array
   Dim r As Long '
  </code></pre>
  
  <p>Code: </p>
  
  <pre><code> For Each workcell In Intersect(ws.UsedRange, ws.Columns(4)) 'Go down the   
   cells in Column D
   If InStr(workcell.Value, ";") &gt; 0 Then 'split
   str = Split(workcell.Value, ";")
   For r = LBound(str) To UBound(str)
   If inStr(";" &amp; Trim(str(r)) &amp; ";") &lt; 1 Then
   if instr(";" &amp; trim(str(r)) &amp; ";") = 0 then
   output = output &amp; Trim(str(r)) &amp; ";" 'Add the number and ";" to the end of the string
   End If
   Next r
   Erase str 'Tidy up array, ready to recycle
   End If
  </code></pre>