Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-15-2012, 01:52 AM
gsrikanth gsrikanth is offline find the word and highlighst vba extention Windows XP find the word and highlighst vba extention Office XP
Competent Performer
find the word and highlighst vba extention
 
Join Date: Dec 2011
Posts: 133
gsrikanth is on a distinguished road
Default find the word and highlighst vba extention

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
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
find the word and highlighst vba extention Word VBA - Find SDondeti Word VBA 4 08-15-2012 05:03 PM
find the word and highlighst vba extention Bad view when using Find and Find & Replace - Word places found string on top line paulkaye Word 4 12-06-2011 11:05 PM
find&replace word in uppercase with word in lowercase andrei Word 3 10-03-2011 05:11 AM
find the word and highlighst vba extention where we can find the meaning for all the marks that Word uses? Jamal NUMAN Word 2 06-26-2011 09:49 AM
How to find out the version of the word files? mariaprabudass Word 0 06-18-2010 05:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft