Tridiro
Board Regular
- Joined
- Apr 26, 2007
- Messages
- 97
Hello Everyone, I really need some help.
I need some code that will look through about 700 rows of numbers in a single column (range1) and see if that number already exist in another range of numbers(range2). If it does, i need it to copy that entire row to say sheet2, then resume checking the numbers where it left off until all duplicate numbers have been copied. this must be done in VBA.
The code below is just some test code, it dont work and i aint even close to getting it.
I need some code that will look through about 700 rows of numbers in a single column (range1) and see if that number already exist in another range of numbers(range2). If it does, i need it to copy that entire row to say sheet2, then resume checking the numbers where it left off until all duplicate numbers have been copied. this must be done in VBA.
The code below is just some test code, it dont work and i aint even close to getting it.
Code:
Sub test()
Dim MyRange As Range
Set MyRange = Range("B1:B20")
For Each cell In MyRange
If cell.Value = Sheets("sheet2").Range("B1:B20").Value Then
MsgBox ("value exist")
Else
MsgBox ("value does not exist")
End If
Next
End Sub