Highlight 30th characther in a each cell in a column

  • Thread starter Thread starter bhagan
  • Start date Start date
B

bhagan

Im working on a spreadsheet and in one column I need to highlight the
30th character of each cell, is there any way this can be done. HELP
 
Not sure what you mean by "highlight". You can only apply character
formatting to constants, not the results of formulas. This changes
the color of the 30th character of all constants in column C to red:


Public Sub ChangeColorOf30thCharacter()
Dim cell As Range
On Error Resume Next
For Each cell In Columns(3).Cells.SpecialCells( _
xlCellTypeConstants, xlTextValues)
cell.Characters(30, 1).Font.ColorIndex = 3
Next cell
On Error GoTo 0
End Sub
 
Back
Top