a user enters a string in a text box on a form, presses a cmd button to start a search. the string fom the texr box is placed in
Range("SearchInput") example string 2JRCEPV0100E**VALVEX
I then run the sub below to copy all matching entries to a different range.
Sub SearchE()
NN = Range("NextTN").Value 'number of entries in first range copied from
SI = Range("SearchInput")
z = 2
For x = 1 To NN
If Cells(x, 4) = SI Then
For y = 1 To 9
Cells(z, y + 26) = Cells(x, y)
Next y
z = z + 1
End If
Next x
End Sub
Of course only exact matches copy. How would I write it so the user could use a wild card, so they could enter say 2JRCEPV0100E% (if % was the wild card)?
thanks,
Chas
Range("SearchInput") example string 2JRCEPV0100E**VALVEX
I then run the sub below to copy all matching entries to a different range.
Sub SearchE()
NN = Range("NextTN").Value 'number of entries in first range copied from
SI = Range("SearchInput")
z = 2
For x = 1 To NN
If Cells(x, 4) = SI Then
For y = 1 To 9
Cells(z, y + 26) = Cells(x, y)
Next y
z = z + 1
End If
Next x
End Sub
Of course only exact matches copy. How would I write it so the user could use a wild card, so they could enter say 2JRCEPV0100E% (if % was the wild card)?
thanks,
Chas