J
J.J.
I found the perfect macro for what I want to do, however, I wish to
add more values to search for. For example, below I chose Lisa, but
what if I were to search for john, jack, and joey as well. How do I go
about adding those values to the string?
Sub Tester03()
Dim sStr As String
Dim sh As Worksheet
Set sh = ActiveSheet
sStr = "Lisa "
With sh.Cells
Set c = .Find(sStr, _
After:=Range("B1"), _
LookIn:=xlValues, _
LookAt:=xlPart, _
MatchCase:=False)
If Not c Is Nothing Then
FirstAddress = c.Address
Do
c.Interior.ColorIndex = 3
Set c = .FindNext(c)
Loop While Not c Is Nothing And _
c.Address <> FirstAddress
End If
End With
End Sub
add more values to search for. For example, below I chose Lisa, but
what if I were to search for john, jack, and joey as well. How do I go
about adding those values to the string?
Sub Tester03()
Dim sStr As String
Dim sh As Worksheet
Set sh = ActiveSheet
sStr = "Lisa "
With sh.Cells
Set c = .Find(sStr, _
After:=Range("B1"), _
LookIn:=xlValues, _
LookAt:=xlPart, _
MatchCase:=False)
If Not c Is Nothing Then
FirstAddress = c.Address
Do
c.Interior.ColorIndex = 3
Set c = .FindNext(c)
Loop While Not c Is Nothing And _
c.Address <> FirstAddress
End If
End With
End Sub