This is the code i use:
[I
]Sub similar()
Dim Sht1Rng As Range
Dim Sht2Rng As Range
Set Sht1Rng = Worksheets("firts").Range("A1", Worksheets("firts").Range("A1100").End(xlUp))
Set Sht2Rng = Worksheets("second").Range("A1", Worksheets("second").Range("A1100").End(xlUp))
For Each c In Sht1Rng
Set d = Sht2Rng.Find(c.Value, LookIn:=xlValues)
If Not d Is Nothing Then
Worksheets("Results").Range("A1100").End(xlUp).Offset(1, 0).Value = c.Value
Worksheets("Results").Range("A1100").End(xlUp).Offset(0, 1).Value = c.Offset(0, 1).Value
Set d = Nothing
End If
Next c
End Sub
[/I]
It selects similar values from column A from these sheets, and puts it into results sheet. In addition to this, what I need is to pick up the whole row from the sheet "Second". I have tried adding
Worksheets("second").Range(d).EntireRow.Select
after looking for similar values, but this causes error. I also need to pick up one more value from sheet "first" and add it to the last column in "results" sheet, but this is secondary problem..
Bookmarks