title: Type Mismatch error in Excel 2010
body: <p>I am running this macro in Excel 2010 over a value of text in Column A. The error message is "Type Mismatch". Is it a coding issue or is it related to Excel 2010? Since the same works well in Excel 2003.</p>
  
  <p>The macro identifies common strings and provides an output with words and counts.</p>
  
  <pre><code>Sub Common_words()
      Dim vArray As Variant
      Dim lLoop As Long
      Dim rCell As Range
  
      With CreateObject("Scripting.Dictionary")
          For Each rCell In Range("A1", Cells(Rows.Count, "A").End(xlUp))
              vArray = Split(rCell.Value, " ")
              For lLoop = LBound(vArray) To UBound(vArray)
                  If Not .exists(vArray(lLoop)) Then
                      .Add vArray(lLoop), 1
                  Else
                      .Item(vArray(lLoop)) = .Item(vArray(lLoop)) + 1
                  End If
              Next lLoop
          Next rCell
          Range("B1").Resize(.Count).Value = Application.Transpose(.keys)
          Range("C1").Resize(.Count).Value = Application.Transpose(.items)
      End With
  End Sub
  </code></pre>