Find and Highlight

P

Paul Black

Hi Everyone,

I have quite large Sheets within Several Workbooks.
Does anybody have a Macro that I can type in a "Word(s) OR Value(s)"
and ALL the Words Or Values that Match within that Sheet are
Highlighted in Bold Red for example. The "Edit" & "Find" is a bit
cumbersome.

Thanks in Advance
Paul
 
P

papou

Hi Paul
Here's a sample code.
See also Conditionnal Formatting.

Sub FindIt()
Dim FindWhat$
Dim i&
Dim RngData As Range
Dim FoundIt As Range
FindWhat = "doc"
For i = 1 To WorkSheets.Count
With ThisWorkbook.WorkSheets(i)
Set RngData = .UsedRange
With RngData
Set FoundIt = .Find(FindWhat)
If Not FoundIt Is Nothing Then
FoundIt.Font.ColorIndex = 3
FoundIt.Font.Bold = True
End If
End With
End With
Next i
End Sub

HTH
Cordially
Pascal
 
P

Paul Black

Thanks Papou and Bob,

Out of interest Papou, how did you manage to answer the Question
BEFORE it was posted on Google.

Thanks
Paul
 
Top