in longhand, SamT's code:
Sub find_strings_2()
Dim ArrayCh() As Variant
Dim C As Range
Dim firstAddress As String
Dim i As Integer
Dim array_example(10)
Dim Rw As Long
Rw = 1
ArrayCh = Array("Home", "Home2") 'strings to lookup
With ActiveSheet.Cells
For i = LBound(ArrayCh) To UBound(ArrayCh)
Set C = .Find(What:=ArrayCh(i), LookAt:=xlPart, LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = C.Address 'used later to verify if looping over the same address
Do
C.Copy
Sheet2.Cells(Rw, "A").PasteSpecial
Rw = Rw + 1
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> firstAddress
End If
Next i
End With
End Sub
But…
Originally Posted by
altrox5
the point is that function search and copy to sheet2 specific value among all values contained in the row A
You realise the code you supplied searches the whole of the active sheet, not just column A?
To search just column A, change:
With ActiveSheet.Cells
to:
With ActiveSheet.columns(1)