PDA

View Full Version : append color text (VBA)



tcwm00a
11-11-2009, 02:23 PM
I have a column of people's names in a black font. Based on a condition (which I can code in VBA), I want to append, say, a RED Asterisk to the end of the people's names? Anyone know how to do this in VBA?

mdmackillop
11-11-2009, 02:33 PM
Something like

Sub Macro1()
For Each cel In Selection
If Left(cel, 1) = "a" Then
cel.Value = cel.Value & "*"
cel.Characters(Start:=Len(cel), Length:=1).Font.Color = vbRed
End If
Next
End Sub

tcwm00a
11-11-2009, 03:17 PM
That did it! Thank you very much!!