i am trying to allow the user to search up to 6 different types of strings( text). However i have tried it for up to 2 ,
Problem
but my code only performs the search correctly for the first one. However any of the searches after fisrt string are not achieving the objective.
Objective
The objective of the code is for it to find the string in the speficied row, then search that coloumn for values greater than zero, if so copy the whole row.
Private Sub btnUpdateEntry_Click()
Dim StringToFind As String
Dim SringToFind2 As String
Dim i As Range
Dim cell As Range
StringToFind = Application.InputBox("Enter string to find", "Find string")
StringToFind2 = Application.InputBox("Enter string to find", "Find string")
With Worksheets("Skills Matrix")
Set cell = .Rows(1).Find(What:=StringToFind, LookAt:=xlWhole, _
MatchCase:=False, SearchFormat:=False)
If Not cell Is Nothing Then
For Each i In .Range(cell.Offset(1), .Cells(.Rows.Count, cell.Column).End(xlUp))
If IsNumeric(i.Value) Then
If i.Value > 0 Then
i.EntireRow.Copy
Sheets("Data").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial
End If
End If
Next i
Else
Worksheets("Data").Activate
MsgBox "String not found"
End If
End With
End Sub
Thank you