title: VBA count and print every cell address when a duplicate value is found
body: <p>I am trying to count the number of cells where a duplicate value is found
   and then print them in a message box.
  At the moment my code successfully finds the values but only print the cell with the second duplicate value and not all the cells with the same value . It must be something like this:</p>
  
  <p>The id "wrong id" is used multiple times  ("ids") .
  *ids of all cells, separated with comma. In this example “A6, A7” .Here is my code:</p>
  
  <pre><code>Sub sbFindDuplicatesInColumn()
  
  Dim cell As Range
  Dim mess As String
  Dim rngcheck As Range
  Dim rng1 As Range
  Dim C As Range
  Dim objDic
  Dim strMsg As String
  
  Set objDic = CreateObject("scripting.dictionary")
  Set rng1 = Range([a1], Cells(Rows.count, "A").End(xlUp))
  For Each C In rng1
  
      If Len(C.Value) &gt; 0 Then
          If Not objDic.exists(C.Value) Then
              objDic.Add C.Value, 1
          Else
              strMsg = strMsg &amp; "The id" &amp; C.Value &amp; " is used multiple times " &amp; C.Address(0, 0) &amp; vbNewLine
          End If
      End If
  Next
      If Len(strMsg) &gt; 0 Then MsgBox strMsg
  End Sub
  </code></pre>