Re: Bedingte Formatierung per Makro
Verfasst: Fr, 28.08.2009 12:20
deutsches Forum rund um Apache OpenOffice und LibreOffice
http://www.oooforum.de/
...mit anderen Worten "alles ungleich 10" ergibt folgenden Code:wenn der Wert höher oder niedriger als 10 ist
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