|
Subject:
|
HELP!
|
|
Posted By:
|
ever
|
Post Date:
|
2/13/2004 11:48:45 AM
|
Hello,
I have a problem. Big time! I am trying to do a comparison of two columns that contain email addresses. If the same email address appears in both column A and Column B. Then I want to Place a '1' or True in column C.
However, I don't know where Column A will be equal to Column B. The two like emails may not occur in the same row. They may occur (for example) in cell A2 and Cell B54. I've tried to sort the columns but that doesn't do it. Any help I get on this will be greatly appreciated. Ever

Music
|
|
Reply By:
|
llewellynj
|
Reply Date:
|
2/14/2004 5:40:35 PM
|
Ever
You need to sort each column individually and then the sort function will work, I tested this in Excel. After you have sorted the columns, then use an IF statement to compare the two columns. E.g formula would be =IF(A1=B1,1,"").
If this does not work another alternative would be to use the following formula: =IF(COUNTIF(A1:A3,B1),1,"")and then you do not need to use the sort function.
Hope these suggestions helps Regards Llewellyn
|
|
Reply By:
|
Birger
|
Reply Date:
|
2/15/2004 3:27:09 AM
|
Maybe you can use this one:
Sub RowNoOfDublet() Dim a, b, c As Integer a = 1 b = 1
Application.ScreenUpdating = False For b = 1 To 50 '(50 is the No of rows in col B) For a = 1 To 50 '(50 is the No of rows in col A) Cells(a, 1).Select If Cells(a, 1).Value = Cells(b, 2).Value Then Cells(b, 3).Value = Cells(a, 1).row End If Next a Next b Application.ScreenUpdating = True
End Sub
In col C it states in which row in A the dublet is found. If you want it only to state a 'True' then replace:
Cells(b, 3).Value = Cells(a, 1).row with Cells(b, 3).Value = "True"
|