COMPARING 7 COLUMN

Closed
parshv Posts 1 Registration date Saturday June 8, 2019 Status Member Last seen June 8, 2019 - Jun 8, 2019 at 05:56 AM
TrowaD Posts 2913 Registration date Sunday September 12, 2010 Status Moderator Last seen November 21, 2022 - Jun 13, 2019 at 12:09 PM
HI

I WOULD LIKE TO KNOW HOW TO COMPARE 7 DIFFERENT COLUMNS AND FIND COMMON VALUE IN NEW COLUMN

I'M ATTACHING ONE SAMPLE HERE

PLEASE CHECK AND GIVE ME FORMULA FOR THAT

THANKS

1 reply

TrowaD Posts 2913 Registration date Sunday September 12, 2010 Status Moderator Last seen November 21, 2022 541
Jun 13, 2019 at 12:09 PM
Hi Parshv,

Please refrain yourself from using all capitals and demanding help.

Here is a code that could help you out:
Sub RunMe()
Dim mFind As Range

For Each cell In Columns("A:A").SpecialCells(xlCellTypeConstants)
    Set mFind = Columns("B:B").Find(cell.Value)
    If mFind Is Nothing Then GoTo nCell
    Set mFind = Columns("C:C").Find(cell.Value)
    If mFind Is Nothing Then GoTo nCell
    Set mFind = Columns("D:D").Find(cell.Value)
    If mFind Is Nothing Then GoTo nCell
    Set mFind = Columns("E:E").Find(cell.Value)
    If mFind Is Nothing Then GoTo nCell
    Set mFind = Columns("F:F").Find(cell.Value)
    If mFind Is Nothing Then GoTo nCell
    Set mFind = Columns("G:G").Find(cell.Value)
    If mFind Is Nothing Then GoTo nCell
    Range("I" & Rows.Count).End(xlUp).Offset(1, 0) = cell.Value
nCell:
Next cell
End Sub


Best regards,
Trowa

0