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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top