All pastes #177919 Raw Edit

Unnamed

public text v1 · immutable
#177919 ·published 2006-09-20 20:43 UTC
rendered paste body
Sub DupeCheck()
Dim i As Long

' Looping through Column B
For i = 1 To Worksheets(1).Columns(2).Rows.Count
Dim objCell As Range
Set objCell = Worksheets(1).Columns(2).Rows(i)

If Not objCell.Value = Empty Then
   Dim objCellsFound As Range

    
  ' For each cell in Column B, look for it in A
  Set objCellsFound = Worksheets(1).Columns(1).Find(objCell.Value)
   
If Not objCellsFound Is Nothing Then
  ' Check to see if any cells matched
  If Not objCellsFound.Count = 0 Then

      ' Go to the row with the same number as the cell we found,
     ' find column "E" and put an "X" in the cell
       Worksheets(1).Rows(objCellsFound.Row).Columns(6).Value = "X"

       End If
  End If
Next

End Sub