C
caldog
I have this code that bolds and that puts color as background if certain
conditions are met. What is not happening is that the text centering line is
erroring out. Can somebody explain why this is.
Steve
Private Sub AAA1_Click()
If Range("A1") = 1 Then
Range("A1").Select
With Selection.Font
.HorizontalAlignment = xlCenter - "Line not working"
.VerticalAlignment = xlCenter - "Line not working"
.ColorIndex = 3
.FontStyle = "Bold"
End With
With Selection.Interior
.ColorIndex = 1
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Else
Range("A1").Select
With Selection.Interior
.ColorIndex = 29
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
conditions are met. What is not happening is that the text centering line is
erroring out. Can somebody explain why this is.
Steve
Private Sub AAA1_Click()
If Range("A1") = 1 Then
Range("A1").Select
With Selection.Font
.HorizontalAlignment = xlCenter - "Line not working"
.VerticalAlignment = xlCenter - "Line not working"
.ColorIndex = 3
.FontStyle = "Bold"
End With
With Selection.Interior
.ColorIndex = 1
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Else
Range("A1").Select
With Selection.Interior
.ColorIndex = 29
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If