dwhitey1124
New Member
- Joined
- Oct 24, 2014
- Messages
- 28
Hi everyone,
I would like to change the color of all underscores ("_") that are in the output of a formula. Right now I have the code for changing the color in constant cells but can't figure it out for cells that have formulas. Any advice would be much appreciated.
I would like to change the color of all underscores ("_") that are in the output of a formula. Right now I have the code for changing the color in constant cells but can't figure it out for cells that have formulas. Any advice would be much appreciated.
HTML:
Dim rng As Range
Dim byt As Byte
For Each rng In Range("A1:r2000").Cells.SpecialCells( _
xlCellTypeConstants, _
xlTextValues)
For byt = 1 To Len(rng.Value)
If Mid$(rng.Value, byt, 1) = Chr(95) Then
rng.Characters(byt, 1).Font.Color = _
rng.Interior.Color
End If
Next byt
Next rng