Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
For next conditional
Hi
I have this code, and is not running properly. I want a conditional format for numbers less than 0 to become in red. any idea, thanks? Sub Conditional() Dim sht As Worksheet For Each sht In ActiveWorkbook.Sheets With sht.Range("C7:C55") .FormatConditions(1).Font.ColorIndex = 3 .FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _ Formula1:="0" End With Next sht End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
For next conditional
You had the cart before the horse:
Sub Conditional() Dim sht As Worksheet For Each sht In ActiveWorkbook.Sheets With sht.Range("C7:C55") .FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _ Formula1:="0" .FormatConditions(1).Font.ColorIndex = 3 End With Next sht End Sub "Faboboren" wrote: Hi I have this code, and is not running properly. I want a conditional format for numbers less than 0 to become in red. any idea, thanks? Sub Conditional() Dim sht As Worksheet For Each sht In ActiveWorkbook.Sheets With sht.Range("C7:C55") .FormatConditions(1).Font.ColorIndex = 3 .FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _ Formula1:="0" End With Next sht End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
For next conditional
JLGWhiz,
Great, is working, thanks "JLGWhiz" wrote: You had the cart before the horse: Sub Conditional() Dim sht As Worksheet For Each sht In ActiveWorkbook.Sheets With sht.Range("C7:C55") .FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _ Formula1:="0" .FormatConditions(1).Font.ColorIndex = 3 End With Next sht End Sub "Faboboren" wrote: Hi I have this code, and is not running properly. I want a conditional format for numbers less than 0 to become in red. any idea, thanks? Sub Conditional() Dim sht As Worksheet For Each sht In ActiveWorkbook.Sheets With sht.Range("C7:C55") .FormatConditions(1).Font.ColorIndex = 3 .FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _ Formula1:="0" End With Next sht End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional Format overwrighting previous conditional format | Excel Programming | |||
Conditional Rank (or rather, Conditional Range) | Excel Worksheet Functions | |||
Conditional Formatting that will display conditional data | Excel Worksheet Functions | |||
Multiple conditional on conditional format formula | Excel Programming | |||
Multiple conditional on conditional format formula | Excel Programming |