von navy-cis » Mo, 26.01.2009 20:33
Hi Karo
vielen Dank für die schnelle Antwort, leider ist dein Vorschlag nicht das was ich suche.
Das Beispiel das ich benutzt habe ist nur eine Zelle ich. In meinem Prog. frage ich 20 Zellen ab.
Ich hatte da er an so etwas gedacht.
Code: Alles auswählen
Sub bedingteFormateEinerZelleAnzeigen
' Variablen deklarieren
Dim oZelle as Object
Dim oBedingtesFormat as Object
Dim nCounter as Integer
Dim sAusgabe as String
' Zelle A1 holen
oZelle = ThisComponent.Sheets(2).getCellByPosition( 5, 8 )
' Schleife durch alle bedingten Formate
For nCounter = 0 To oZelle.ConditionalFormat.Count-1
' bedingtes Formate holen
oBedingtesFormat = oZelle.ConditionalFormat(nCounter)
' Ausgabe der Eigenschaften
sAusgabe = (nCounter+1) & ". Bedingtes Format:" & chr(13)
sAusgabe = sAusgabe & "Operator: " & _
oBedingtesFormat.Operator & chr(13)
sAusgabe = sAusgabe & "Formel 1: " & _
oBedingtesFormat.Formula1 & chr(13)
sAusgabe = sAusgabe & "Formel 2: " & _
oBedingtesFormat.Formula2 & chr(13)
sAusgabe = sAusgabe & "Formatvorlage: " & _
oBedingtesFormat.StyleName & chr(13)
' Ausgabe anzeigen
MsgBox sAusgabe
Next nCounter
End Sub
ich würde gerne den StyleName abfragen. Damit ich das ganze in einer Schleife laufen lassen kann.
Gruß navy-cis
Hi Karo
vielen Dank für die schnelle Antwort, leider ist dein Vorschlag nicht das was ich suche.
Das Beispiel das ich benutzt habe ist nur eine Zelle ich. In meinem Prog. frage ich 20 Zellen ab.
Ich hatte da er an so etwas gedacht.
[code]
Sub bedingteFormateEinerZelleAnzeigen
' Variablen deklarieren
Dim oZelle as Object
Dim oBedingtesFormat as Object
Dim nCounter as Integer
Dim sAusgabe as String
' Zelle A1 holen
oZelle = ThisComponent.Sheets(2).getCellByPosition( 5, 8 )
' Schleife durch alle bedingten Formate
For nCounter = 0 To oZelle.ConditionalFormat.Count-1
' bedingtes Formate holen
oBedingtesFormat = oZelle.ConditionalFormat(nCounter)
' Ausgabe der Eigenschaften
sAusgabe = (nCounter+1) & ". Bedingtes Format:" & chr(13)
sAusgabe = sAusgabe & "Operator: " & _
oBedingtesFormat.Operator & chr(13)
sAusgabe = sAusgabe & "Formel 1: " & _
oBedingtesFormat.Formula1 & chr(13)
sAusgabe = sAusgabe & "Formel 2: " & _
oBedingtesFormat.Formula2 & chr(13)
sAusgabe = sAusgabe & "Formatvorlage: " & _
oBedingtesFormat.StyleName & chr(13)
' Ausgabe anzeigen
MsgBox sAusgabe
Next nCounter
End Sub
[/code]
ich würde gerne den StyleName abfragen. Damit ich das ganze in einer Schleife laufen lassen kann.
Gruß navy-cis