title: Excel VBA Run-time error '13': Type mismatch
body: <p>I'm not great at VBA, but all of a sudden, I started getting this error. Please let me know if you can find what the error is. I'm so stuck on this one. I did search everywhere and found lots of similar posts but the solution always seems to be very specific to the code. Any of you experts would be greatly appreciated.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>Sub FindSimilar()
      Dim phrases As Range, phrase As Range
      Dim terms As Range, term As Range
      Dim matches As String
      Dim words() As String
  
      'ensure this has the correct sheet names for your workbook
      Set phrases = ThisWorkbook.Worksheets("Export").Range("B2:B3500")
      Set terms = ThisWorkbook.Worksheets("Topics").Range("D767:D967")
  
      For Each term In terms
          matches = ""
          words() = Split(term.Value)
  
          For i = 0 To UBound(words, 1)
          If Len(words(i)) &gt; 2 Then
           Select Case words(i)
            Case "examplewords", "blacklist"
            Case Else
              For Each phrase In phrases
                  If InStr(1, phrase.Value, words(i)) Then
                      matches = matches &amp; phrase &amp; "/"
                  End If
              Next phrase
           End Select
          End If
  </code></pre>
  
  <p>I'm really at a loss as to why the </p>
  
  <blockquote>
    <p>Run-time error 13: Type mismatch</p>
  </blockquote>
  
  <p>is being thrown. </p>
  
  <p>The breakpoint occurs at the following lines:</p>
  
  <pre><code>        matches = ""
  </code></pre>
  
  <p>And</p>
  
  <pre><code>       Set terms = ThisWorkbook.Worksheets("Topics").Range("D773:D779")
  </code></pre>
  
  <p>And</p>
  
  <pre><code>       For i = 0 To UBound(words, 1)
  </code></pre>