Date: prev next · Thread: first prev next last
2020 Archives by date, by thread · List index


Hallo Volker,

ganz herzlichen Dank für den Hinweis.

Mit || oB(1).Value = "INDIRECT(ADDRESS(ROW();COLUMN()))-INDIRECT(ADDRESS(ROW()-1;COLUMN())) < 0" || funktioniert es, wie es sollte.

Mit || oB(1).Value = "INDIREKT(ADRESSE(ZEILE();SPALTE()))-INDIREKT(ADRESSE(ZEILE()-1;SPALTE())) < 0" || passiert folgendes:

Nach Ausführung des Makros erscheint die Formel erst mal so || indirekt(adresse(zeile();spalte()))-indirekt(adresse(zeile()-1;spalte())) < 0 || unter [Format][Bedingte Formatierung].

Nach manuell [Format] > [Bedingte Formatierung] > [Verwalten...] > [Bearbeiten] > [OK] > [OK] ist sie dann so || INDIREKT(ADRESSE(ZEILE();SPALTE()))-INDIREKT(ADRESSE(ZEILE()-1;SPALTE())) < 0 || unter [Format][Bedingte Formatierung] eingetragen und funktioniert.

In einem Beispiel von http://www.dannenhoefer.de/faqstarbasic/BedingteFormatierungInsert.html#BedingteFormatierungInsert ist die Formel auch in englischer Sprache eingetragen || oCondition(1).Value = "SUM(A1:A10) > 100" ||, was mir aber erst mal nicht wirklich aufgefallen ist. Bei Pitonyak/Lenhardt gibt es kein Beispiel mit "Formel".

Aber weder bei Pitonyak/Lenhardt noch bei Dannenhöfer wird explizit darauf hingewiesen, dass in einer Formel englische Ausdrücke zu benutzen sind. Andere WEB-Quellen hatte ich nicht recherchiert.

Ob BUG oder nicht, ist für mich als einen "Nicht-LO-Software-Entwickler" nicht wirklich entscheidbar, aber auffällig ist schon, dass die (deutsche) Formel nach manuell [Format] > [Bedingte Formatierung] > [Verwalten...] > [Bearbeiten] > [OK] > [OK] in Großbuchstaben umgewandelt wird und dann auch in deutscher Version funktioniert.

Hinweise für Wolfgang:

[1] Die Formel ist nicht fehlerhaft, sondern zur besseren Nachvollziehbarkeit aus dem "Zusammenhang gerissen" eines 1347 Zeilen langen Makros. [2] Normalerweise setze ich "bedingte Formatierungen" auch manuell, es kommt immer auf den Kontext der gesamten Anwendung an.

Gruß
Hans-Werner

Hier noch der Vollständigkeit halber die ursprüngliche Problembeschreibung:

[1] CALC-Tabelle

|1|4|1|4|
|2|3|2|3|
|3|2|3|2|
|4|1|4|1|

[2] BasicMakro

Sub BedingteFormatierung

Dim oBF as Object ' obj Bedingung Format (Conditional Format)
Dim oBFB as Object ' obj Bedingung Format Bereich
Dim oB(2) as New com.sun.star.beans.PropertyValue ' Bedingung (Condition)

oBFB = ThisComponent.Sheets(0).getCellRangeByPosition(0,0,3,3)
oBF = oBFB.ConditionalFormat

oB(0).Name = "Operator"
oB(0).Value = com.sun.star.sheet.ConditionOperator.FORMULA
oB(1).Name = "Formula1"

oB(1).Value = "INDIREKT(ADRESSE(ZEILE();SPALTE()))-INDIREKT(ADRESSE(ZEILE()-1;SPALTE())) < 0" ' ERROR-Variante

' oB(1).Value = "INDIRECT(ADDRESS(ROW();COLUMN()))-INDIRECT(ADDRESS(ROW()-1;COLUMN())) < 0" ' 
OKAY-Variante

oB(2).Name = "StyleName"
oB(2).Value = "Bad"

oBF.addNew(oB())
oBFB.ConditionalFormat = oBF

End Sub

--
Liste abmelden mit E-Mail an: users+unsubscribe@de.libreoffice.org
Probleme? https://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: https://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: https://listarchives.libreoffice.org/de/users/
Datenschutzerklärung: https://www.documentfoundation.org/privacy

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.