How do i make certain words automatically bold themselves.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need certain words in my scedules to be bold. I dont want to have to go
through all my charts and select these individual words & i would like to
have these specific words just become bold as i type them in the future.
Please help.
 
right click sheet tab>view code>copy/paste this. I commented out other
examples

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Then Exit Sub

'Target.Offset(, -1) = Target.Row
'If Target > 4 Then Target.Borders.Weight = xlThick
''If Target = "jj" Then Target.Font.Bold = True

Select Case Target
Case "jj", "kk", "ll" : Target.Font.Bold = True
End Select
End Sub
 
Are these words by themselves in a cell or part of other text in a cell?

Which words do you want bolded?

Are they located in any particular range?


Gord Dibben MS Excel MVP
 
Gordon,

for example:

Stainless Steel Wall Mounted Handrail at Auditorium

all of the above is in a single cell together. only stainless steel would
need to be in bold. they are in column B which is labeled description with
no codes.
 
this makes absolutly no sence to me.

Don Guillett said:
right click sheet tab>view code>copy/paste this. I commented out other
examples

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Then Exit Sub

'Target.Offset(, -1) = Target.Row
'If Target > 4 Then Target.Borders.Weight = xlThick
''If Target = "jj" Then Target.Font.Bold = True

Select Case Target
Case "jj", "kk", "ll" : Target.Font.Bold = True
End Select
End Sub
 
Sub boldselectedword()
myword = "bbb"
fc = InStr(activecell, myword)
lc = Len(myword)
ActiveCell.Characters(fc, lc).Font.Bold = True
End Sub
 
to do all in selection

Sub bsw()
myword = "bbb"
For Each c In Selection
fc = InStr(c, myword)
MsgBox fc
lc = Len(myword)
MsgBox lc
If fc > 0 Then c.Characters(fc, lc).Font.Bold = True
Next
End Sub
 
Back
Top