RAYLWARD102
Well-known Member
- Joined
- May 27, 2010
- Messages
- 529
Whats the simplest way for me to search through data finding for example "tom" form a range. In the range I'd want it to indicate found item for "tomb" as it contains tom. I wrote the code below but wasn't sure about wildcard usage.
Code:
Sub test()
Dim cell As Range
Dim ite As Worksheet
Set ite = Worksheets("sheet1")
Dim keyW As String
keyW = "tom"
For Each cell In ite.Range("a1:a15").Cells
If cell.Value = "*" & keyW & "*" Then
ite.Range("b" & cell.Row).Value = 1
End If
Next cell
End Sub