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


Hallo Volker, Hans-Werner,

das funktioniert!
Kannst du erklären, warum das so ist? Versteht die Zuweisung in Basic nur die englische Formulierung, die wahrscheinlich die eigentlich gültige ist? Stößt der Dialog für die Bedingte Formatierung da die "Übersetzung" an?
Das nur, um mein Wissen zu erweitern.

Viele Grüße
Gerhard

Am 22.06.2020 um 23:32 schrieb Volker Lenhardt:
Hallo, Hans-Werner,

die Formeln müssen englisch sein. Versuch's mal mit:

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

Schöne Grüße
Volker

Am 22.06.20 um 20:17 schrieb OoOHWHOoO:
Hallo,

folgendes Problem:

Gegeben sei folgende kleine CALC-Tabelle

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

und dieser BasicMakro-Code:

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"
oB(2).Name = "StyleName"
oB(2).Value = "Bad"

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

End Sub

Nach Ausführung des Makros sind der "Bereich" ( oBFB ), die "Bedingung" ( oB(1).Value ) und die "Vorlage" ( oB(2).Value ) richtig eingetragen, aber die so eingetragene "bedingte Formatierung" ist nicht aktiv, d.h., keine Einfärbung der betroffenen Zellen gemäß "Vorlage".

Nach manuell

[Format] > [Bedingte Formatierung] > [Verwalten...] > [Bearbeiten] > [OK] > [OK]

ist die "bedingte Formatierung" aktiv und die entsprechenden Zellen sind sofort eingefärbt.

Der BasicMakro-Code ist sowohl bei  Pitonyak/Lenhardt als auch Dannenhöfer so angegeben wie oben. Mir ist jedenfalls kein Unterschied aufgefallen ...

Habe ich da noch irgendeinen Fehler in meinem BasicMakro-Code ?
Fehlt da noch was, um die "bedingte Formatierung" zu aktivieren oder liegt da ein BUG vor ?

Mir fällt im Moment nichts weiter ein,
bin für jeden Hinweis dankbar

Grüße
Hans-Werner :-))







--
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.