find the word and highlighst vba extention

gsrikanth

Board Regular
Joined
Jan 7, 2012
Messages
210
find the word and highlighst vba extention <hr style="color:#D1D1E1; background-color:#D1D1E1" size="1"> below code is for one word monkey
in this only i want to search more words how?
Sub example()

Dim iLoop As Integer
Dim i As Integer
Dim rNa As Range

' count number of monkeys in Activesheet (change to sheet required)
iLoop = WorksheetFunction.CountIf(ActiveSheet.UsedRange, "*" & "monkey" & "*")

' loop through and find monkeys
Set rNa = ActiveSheet.Range("A1") ' change sheet if necessary
For i = 1 To iLoop
Set rNa = Cells.Find(What:="monkey", After:=rNa, _
LookIn:=xlValues, LookAt:=xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False)
' highlight the rows
rNa.EntireRow.Interior.ColorIndex = 36
Next i

End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Can't you use Conditional Formatting for that? CF formula:

=OR(ISNUMBER(SEARCH("monkey",A1)),ISNUMBER(SEARCH("gorilla",A1)),ISNUMBER(SEARCH("chimpanzee",A1)))
 
Upvote 0
Can't you use Conditional Formatting for that? CF formula:

=OR(ISNUMBER(SEARCH("monkey",A1)),ISNUMBER(SEARCH("gorilla",A1)),ISNUMBER(SEARCH("chimpanzee",A1)))

i have about 100 words to check

in vba code just i want to kept ("monkey"&"gorilla"&"Tiger"&.........) so on
 
Upvote 0

Forum statistics

Threads
1,215,098
Messages
6,123,082
Members
449,094
Latest member
mystic19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top