passinthru
Board Regular
- Joined
- Jun 16, 2003
- Messages
- 185
Hi, folks. Some weeks ago I recorded a very simple macro to conditionally format some cells. It's been working fine. Today, it's broken.
It was recorded, and is being used, on the same machine; Win7 64bit, and I'm using Excel 2010. No changes that I know of.
When I run the macro (from a button on the ribbon), it stops with the error message, "Run-time error '1004': Application-defined or object-defined error"
Here's the code:
When I choose to debug, it highlights this line:
I've tried re-recording it, and I get the same results. It breaks on the same line.
Has anyone a clue why this is suddenly not working? How can I fix this?
It was recorded, and is being used, on the same machine; Win7 64bit, and I'm using Excel 2010. No changes that I know of.
When I run the macro (from a button on the ribbon), it stops with the error message, "Run-time error '1004': Application-defined or object-defined error"
Here's the code:
Code:
Sub AA_cond_format_column_less_than_50()
'
' AA_cond_format_column_less_than_50 Macro
'
'
Columns("F:F").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
Formula1:="=50"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Range("A1").Select
End Sub
When I choose to debug, it highlights this line:
Code:
.Color = -16383844
I've tried re-recording it, and I get the same results. It breaks on the same line.
Has anyone a clue why this is suddenly not working? How can I fix this?