Highlight Find

Orangeanorak

Active Member
Joined
Nov 22, 2002
Messages
274
Office Version
  1. 365
Platform
  1. Windows
In excel 2003 when using the find function to search for a particular name or number is it possible to have that name or number highlighted in a different colour to allow me to see it quickly

Thank you
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

kevatarvind

Well-known Member
Joined
Mar 3, 2013
Messages
1,047
Office Version
  1. 365
Platform
  1. Windows
try below code
Code:
Sub Find_Highlight()
On Error GoTo err_desc
Dim found As String
found = InputBox("What To Find", "Find And Highlight")
If found <> "" Then Cells.Find(what:=found, Lookat:=xlWhole).Select
Selection.Interior.ColorIndex = 6
Exit Sub
err_desc:
If Err.Number = 91 Then MsgBox "Value Not found."
End Sub
 
Upvote 0

Orangeanorak

Active Member
Joined
Nov 22, 2002
Messages
274
Office Version
  1. 365
Platform
  1. Windows
Grateful for furter advice please
How can the code be changed to highlight all the occurrences of the name or number i.e. find all
 
Upvote 0

Orangeanorak

Active Member
Joined
Nov 22, 2002
Messages
274
Office Version
  1. 365
Platform
  1. Windows
ADVERTISEMENT
And id like to highlight in colour the actual word or number I am trying to find - not highlight the cell background please
 
Upvote 0

farmerscott

Well-known Member
Joined
Jan 26, 2013
Messages
818
Office Version
  1. 365
Platform
  1. Windows
try changing......

Selection.Interior.ColorIndex = 6

to

Selection.Font.Color = vbYellow

FarmerScott
 
Upvote 0

Orangeanorak

Active Member
Joined
Nov 22, 2002
Messages
274
Office Version
  1. 365
Platform
  1. Windows
Thank you however this does not show all the occurrences of the word or number I want to highlight. Also most of my cells contain more than one word. This formula finds only cells with one word in it.

As an example I want to find and highlight in a different colour ALL occurences of the word Smith

cell a1 John Smith
cell a2 Mary White
cell a3 James Smith
cell a4 Smith Street
cell a5 Jack Smart
cell a6 Blacksmith
cell a7 Sam has a friend called Fern Smith
 
Upvote 0

Forum statistics

Threads
1,196,014
Messages
6,012,859
Members
441,736
Latest member
Tkpmm

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
Top