satyen
09-08-2009, 01:06 PM
HI
Im am trying to compare two columns. Basically to see if Names in column B exist in column A. if yes then indicate in an empty column next to the item
I have tried this code which I got from another site-modified slightly.
Sub Compare()
Dim i As Long, n As Long
n = Application.Max(Range("A65536").End(xlUp).Row,
Range("B65536").End(xlUp).Row)
For i = 2 To n
If Range("B" & i).Value = Range("A" & i).Value Then Range("v" & _
i).Value = "Yes"
Next i
End Sub
Its doing for the first name and as soon it comes to another name it doesnt do it.
There are more than 1900 rows. I tried doing a loop but it takes a very long time. Need something quick.
Please can anyone help?
Many Thanks.
Im am trying to compare two columns. Basically to see if Names in column B exist in column A. if yes then indicate in an empty column next to the item
I have tried this code which I got from another site-modified slightly.
Sub Compare()
Dim i As Long, n As Long
n = Application.Max(Range("A65536").End(xlUp).Row,
Range("B65536").End(xlUp).Row)
For i = 2 To n
If Range("B" & i).Value = Range("A" & i).Value Then Range("v" & _
i).Value = "Yes"
Next i
End Sub
Its doing for the first name and as soon it comes to another name it doesnt do it.
There are more than 1900 rows. I tried doing a loop but it takes a very long time. Need something quick.
Please can anyone help?
Many Thanks.