LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default How to add multiple values to this macro

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding multiple values in one column based on multiple values of the same value (text) in another column [email protected] Excel Discussion (Misc queries) 1 May 16th 07 06:02 PM
Adding numerical values based on multiple values in another column Kazmaniac Excel Worksheet Functions 6 April 4th 07 08:53 PM
macro to change multiple values in a column mrwawa Excel Discussion (Misc queries) 7 July 2nd 06 04:35 PM
Search multiple values to return single values JANA Excel Worksheet Functions 8 October 27th 05 04:26 PM
multiple series of values graphed with indep. x values -possible? Gburg Johnny Charts and Charting in Excel 1 September 19th 05 05:32 AM


All times are GMT +1. The time now is 02:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"