I'm trying to get the search string typed in the inputbox to be used in conjunction with the * wildcard to search for instances of the string within the selected range.
Sub color()
Dim myRange As Range, value As String, wild As Icon
value = InputBox("Search String:")
If value = vbNullString Then Exit Sub
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
For Each myRange In Selection
If myRange.value = "*" & value & "*" Then
myRange.Interior.ColorIndex = 3
End If
Next myRange
End Sub
Another possibility: Why use wildcards at all? There is already a VBA function to test for substrings. Try: