Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
General Text Search and Highlight
Been trying to find a macro, example on how I might perform a find
that will highlight all occurences of a word that I want to search for throughout a worksheet. Any suggestions would be much appreciated. Thanks, Jeffro |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
General Text Search and Highlight
Sub FindMe() ' Highlights cells that contain "Hello" Dim rngC As Range Dim strToFind As String, FirstAddress As String strToFind = "Hello" With ActiveSheet.UsedRange Set rngC = .Find(what:=strToFind, LookAt:=xlPart, _ LookIn:=xlFormulas) If Not rngC Is Nothing Then FirstAddress = rngC.Address Do rngC.Interior.Pattern = xlPatternGray50 Set rngC = .FindNext(rngC) Loop While Not rngC Is Nothing And rngC.Address < _ FirstAddress End If End With End Sub Tested using Excel 97SR2 on Windows 98SE, HTH Paul -------------------------------------------------------------------------------------------------------------- Be advised to back up your WorkBook before attempting to make changes. -------------------------------------------------------------------------------------------------------------- Been trying to find a macro, example on how I might perform a find that will highlight all occurences of a word that I want to search for throughout a worksheet. Any suggestions would be much appreciated. Thanks, Jeffro |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
General Text Search and Highlight
See the help example in the VBE for FindNext
-- Regards, Tom Ogilvy "Jeffro" wrote in message om... Been trying to find a macro, example on how I might perform a find that will highlight all occurences of a word that I want to search for throughout a worksheet. Any suggestions would be much appreciated. Thanks, Jeffro |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to highlight the results of a search string in a worksheet? | Excel Worksheet Functions | |||
Highlight Search Results | Excel Discussion (Misc queries) | |||
Search and highlight | Excel Discussion (Misc queries) | |||
Format: General - Text - General | Excel Worksheet Functions | |||
Search should highlight entire row in Excell in red | Excel Discussion (Misc queries) |