Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The following code will display message boxes showing where the same ID numbers are found on diferent worksheets in the workbook. It assumes the identifier column is column A and that there are no blank cells within the data in column A</p> <pre><code>Sub CheckSub() Const iIDENTIFIER_COLUMN = 1 Dim wsCurrentWorksheet As Worksheet Dim wsWorksheetToCheck As Worksheet Dim lCurrentRow As Long Dim lCheckRow As Long Dim iWorkbookNumber As Integer Dim iWorkbookCount As Integer Dim iCheckbookNumber As Integer iWorkbookCount = ThisWorkbook.Sheets.Count For iWorkbookNumber = 1 To iWorkbookCount lCurrentRow = 2 Set wsCurrentWorksheet = ThisWorkbook.Sheets(iWorkbookNumber) Do While wsCurrentWorksheet.Cells(lCurrentRow, iIDENTIFIER_COLUMN).Value &lt;&gt; Empty For iCheckbookNumber = iWorkbookNumber To iWorkbookCount Set wsWorksheetToCheck = ThisWorkbook.Sheets(iCheckbookNumber) If wsCurrentWorksheet.Name &lt;&gt; wsWorksheetToCheck.Name Then lCheckRow = 2 Do While wsWorksheetToCheck.Cells(lCheckRow, iIDENTIFIER_COLUMN).Value &lt;&gt; Empty If wsCurrentWorksheet.Cells(lCurrentRow, iIDENTIFIER_COLUMN).Value = _ wsWorksheetToCheck.Cells(lCheckRow, iIDENTIFIER_COLUMN).Value Then MsgBox (wsCurrentWorksheet.Cells(lCurrentRow, iIDENTIFIER_COLUMN).Value _ &amp; " found on " &amp; wsCurrentWorksheet.Name &amp; " and " &amp; wsWorksheetToCheck.Name) End If lCheckRow = lCheckRow + 1 Loop End If Next iCheckbookNumber lCurrentRow = lCurrentRow + 1 Loop Next iWorkbookNumber End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    1. 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