von Karolus » Fr, 28.08.2009 14:14
Hallo
Angepasst an den Bereich E2:E10 und die urspr. Fagestellung...
wenn der Wert höher oder niedriger als 10 ist
...mit anderen Worten "alles ungleich 10" ergibt folgenden Code:
Code: Alles auswählen
Sub BedForm
Dim oCellrange as Object
Dim oConditionalForm as Object
oCellrange = ThisComponent.Sheets(0).getCellrangeByPosition( 4,1,4,9 )
oConditionalForm = oCellrange.ConditionalFormat
Dim oCondition(3) as New com.sun.star.beans.PropertyValue
oCondition(0).Name = "Operator"
oCondition(0).Value = com.sun.star.sheet.ConditionOperator.NOT_EQUAL
oCondition(1).Name = "Formula1"
oCondition(1).Value = "10"
oCondition(2).Name = "StyleName"
oCondition(2).Value = "Ergebnis"
oConditionalForm.addNew( oCondition() )
oCellrange.ConditionalFormat = oConditionalForm
End Sub
Gruß Karo
Hallo
Angepasst an den Bereich E2:E10 und die urspr. Fagestellung...[quote]wenn der Wert höher oder niedriger als 10 ist[/quote]...mit anderen Worten "alles ungleich 10" ergibt folgenden Code:
[code]Sub BedForm
Dim oCellrange as Object
Dim oConditionalForm as Object
oCellrange = ThisComponent.Sheets(0).getCellrangeByPosition( 4,1,4,9 )
oConditionalForm = oCellrange.ConditionalFormat
Dim oCondition(3) as New com.sun.star.beans.PropertyValue
oCondition(0).Name = "Operator"
oCondition(0).Value = com.sun.star.sheet.ConditionOperator.NOT_EQUAL
oCondition(1).Name = "Formula1"
oCondition(1).Value = "10"
oCondition(2).Name = "StyleName"
oCondition(2).Value = "Ergebnis"
oConditionalForm.addNew( oCondition() )
oCellrange.ConditionalFormat = oConditionalForm
End Sub[/code]
Gruß Karo