Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This will output a list of all ID's that were found more than once and what sheets they were found in on a summary sheet:</p> <pre><code>Sub tgr() Const strIDCol As String = "A" Const lHeaderRow As Long = 1 Dim cllIDs As Collection Dim ws As Worksheet Dim IDCell As Range Dim arrUnqIDs(1 To 65000) As Variant Dim arrMatches(1 To 65000) As String Dim ResultIndex As Long Dim lUnqIDCount As Long Set cllIDs = New Collection For Each ws In ActiveWorkbook.Sheets With Range(ws.Cells(lHeaderRow + 1, strIDCol), ws.Cells(ws.Rows.Count, strIDCol).End(xlUp)) If .Row &gt; lHeaderRow Then For Each IDCell In .Cells On Error Resume Next cllIDs.Add IDCell.Text, LCase(IDCell.Text) On Error GoTo 0 If cllIDs.Count &gt; lUnqIDCount Then lUnqIDCount = cllIDs.Count arrUnqIDs(lUnqIDCount) = IDCell.Text arrMatches(lUnqIDCount) = ws.Name Else ResultIndex = WorksheetFunction.Match(IDCell.Text, arrUnqIDs, 0) arrMatches(ResultIndex) = arrMatches(ResultIndex) &amp; "|" &amp; ws.Name End If Next IDCell End If End With Next ws If lUnqIDCount &gt; 0 Then With Sheets.Add(Before:=ActiveWorkbook.Sheets(1)) With .Range("A1:B1") .Value = Array("Intersecting ID's", "Intersected in Sheets...") .Font.Bold = True End With .Range("A2").Resize(lUnqIDCount).Value = Application.Transpose(arrUnqIDs) .Range("B2").Resize(lUnqIDCount).Value = Application.Transpose(arrMatches) .UsedRange.AutoFilter 2, "&lt;&gt;*|*" .UsedRange.Offset(1).EntireRow.Delete .UsedRange.AutoFilter .Range("A1").CurrentRegion.EntireColumn.AutoFit End With End If Set cllIDs = Nothing Set ws = Nothing Set IDCell = Nothing Erase arrUnqIDs Erase arrMatches End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload