conditional formatting only applies to part of cell text
Sub Bold_String()
Dim rng As Range
Dim Cell As Range
Dim start_str As Integer
Set rng = Selection
For Each Cell In rng
start_str = InStr(Cell.Value, "PCC")
If start_str Then
With Cell.Characters(start_str, 3).Font
.Bold = True
.ColorIndex = 10
End With
End If
Next
End Sub
Gord Dibben MS Excel MVP
On Mon, 5 May 2008 16:08:01 -0700, klkropf
wrote:
Do you know what the VBA code would be?
"akphidelt" wrote:
That would require VBA coding. Theres no way to do that with the normal
conditional formatting that excel gives you.
"klkropf" wrote:
I only want the condtional formatting to apply to the part of the text that
equals "PCC". For example, the value of the cell may be, "Jane Smith - PCC"
and I only want PCC to be bold and green and Jane Smith to remain the same.
|