Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anybody know a way of scanning an excel workbook

Status
Not open for further replies.

finglem

Technical User
Nov 14, 2003
66
GB
Does anybody know a way of scanning an excel workbook for a text string and if the string is found, then making the cell(s) in which the text string resides bold or coloured. Can this be done in code?
Any help much appreciated. Thanks
 
Try something like this in your code

Cells.Find(What:="WHAT YOUR LOOKING FOR", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Selection.Font.ColorIndex = 3
Cells.FindNext(After:=ActiveCell).Activate
Selection.Font.ColorIndex = 3

This colours the selected cell text red.

You could use a loop to go throught until the findnext property was false.

This might help. let me know

dyarwood
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top