ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Tough One - search for string and BOLD it. (https://www.excelbanter.com/excel-programming/381011-re-tough-one-search-string-bold.html)

JakeyC

Tough One - search for string and BOLD it.
 
Yes, it should be possible. No time to write code for you, but to get
you started, record a Macro and manually make some text within text
bold - you should seee something similar to:

With ActiveCell.Characters(Start:=3, Length:=5).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With

This applies the font settings to characters 3-7 of the string in the
current cell.

Next, you'll need to replace
Start:=3, Length:=5
with the actual start and length of your smaller text string. To do
this, look at using the FIND() worksheet formula.

Finally, to locate a cell that has a long string which containins your
shorter string, use the .Find method of Range.
Doug929 wrote:
OK, I tried to get this going but wonder if any one has done this and has it
written, sounds simple enough....

I want to walk down a column and look for a certain word in the cell and
then bold just the word. Can it be done? Dave?....

walking down the column is easy enough but to find just the word and bold
just the word? I dont know...




All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com