[Solved] using instr to find values in vba


You can try this:

Sub find()
    Dim x As String, i As Long, lastrow As Long, y As Long
    Dim sh1 As Worksheet, sh2 As Worksheet
    Set sh1 = Sheets("Sheet1"): Set sh2 = Sheets("Sheet2")
    x = "ra01"

    With sh1
        lastrow = .Range("F" & .Rows.Count).End(xlUp).Row
        For i = 2 To lastrow
            If InStr(.Range("F" & i).Value, x) <> 0 Then
                .Range("A" & i).Copy _
                sh2.Range("A" & sh2.Rows.Count).End(xlUp).Offset(1, 0)
            End If
        Next i
    End With
End Sub

HTH.

1

solved using instr to find values in vba