In the code below I set conditional formatting of the font, then I test for a string of text and set alignment.
How can I set the alignment before the text has been entered?
Range("F10:F30").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=""TPG#"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = True
.TintAndShade = 0
End With
For Each c In Selection 'begin alignment formatting
If Left(c.Value, 3) = "TPG" Then
c.HorizontalAlignment = xlGeneral
c.VerticalAlignment = xlBottom
End If
Next c
Range("D10").Select
Bookmarks