Find and Highlight

  • Thread starter Thread starter Paul Black
  • Start date Start date
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
 
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
 
Thanks Papou and Bob,

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

Thanks
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top