text formatting help

Blauv

Board Regular
Joined
Mar 26, 2010
Messages
126
Code:
Sub AddFormCond()





         With Range("A2:I2").FormatConditions.Add( _
        Type:=xlExpression, _
        Formula1:="=$A2=""SAP""")
    
        .Interior.Color = RGB(255, 128, 0)
        .Font.Color = RGB(0, 0, 0)
        .StopIfTrue = False
        .Font.Bold = True
        
    End With
    
        With Range("A2:I2").FormatConditions.Add( _
        Type:=xlExpression, _
        Formula1:="=$A2=""RP""")
    
        .Interior.Color = RGB(0, 102, 204)
        .Font.Color = RGB(0, 0, 0)
        .StopIfTrue = False
        .Font.Bold = True
    End With
    








End Sub
I am using the above code to add some conditional format to cells.
I would like the Text centered but nothing I try centers the Text.

Any help here is appreciated.
 

FDibbins

Well-known Member
Joined
Feb 16, 2013
Messages
6,723
I have just double-checked and cannot find anywhere in CF that will align cells. Maybe just use regular formatting instead?
 

Blauv

Board Regular
Joined
Mar 26, 2010
Messages
126
doesnt work the CF overrides it and sets one cell left, one right, one left, back and forth.
 

FDibbins

Well-known Member
Joined
Feb 16, 2013
Messages
6,723
I don't see that CF would be doing that, because you cannot use CF to do that. Maybe you have something else running in the background?
 

Forum statistics

Threads
1,078,211
Messages
5,338,888
Members
399,265
Latest member
aj17x55

Some videos you may like

This Week's Hot Topics

Top