Sub
Listformatcond()
Dim
ws
As
Worksheet
Dim
x
As
FormatCondition, bdel
As
Boolean
Dim
i
As
Long
: i = 2
Dim
cnt
As
Integer
Dim
wsobjfc
As
Worksheet
Application.Calculation = xlManual
On
Error
Resume
Next
Set
wsobjfc = ActiveWorkbook.Worksheets(
"objfc"
)
If
Err > 0
Then
Set
wsobjfc = Worksheets.Add: wsobjfc.Name =
"objfc"
: Err = 0
bdel =
False
wsobjfc.Cells.ClearContents
With
wsobjfc
.Cells(1, 1).Value =
"Sheetname"
.Cells(1, 2).Value =
"FC Prio"
.Cells(1, 3).Value =
"FC Gültig für"
.Cells(1, 4) =
"Interior.Color"
.Cells(1, 5) =
"Interior.ColorIndex"
.Cells(1, 6) =
"Interior.TintAndShade"
.Cells(1, 7) =
"Formel"
End
With
For
Each
ws
In
ActiveWorkbook.Worksheets
If
ws.Name =
"Checkliste"
Then
For
cnt = 1
To
ws.Cells.FormatConditions.Count
Set
x = ws.Cells.FormatConditions(cnt)
If
bdel
Then
x.Delete
cnt = cnt - 1
Else
wsobjfc.Cells(i, 1).Value = ws.Name
wsobjfc.Cells(i, 2).Value = x.Priority
wsobjfc.Cells(i, 3).Value = x.AppliesTo.Address(0, 0)
wsobjfc.Cells(i, 4) =
CStr
(x.Interior.Color)
wsobjfc.Cells(i, 4).Interior.Color = x.Interior.Color
wsobjfc.Cells(i, 5) =
CStr
(x.Interior.ColorIndex)
wsobjfc.Cells(i, 5).Interior.ColorIndex = x.Interior.ColorIndex
wsobjfc.Cells(i, 6) =
CStr
(x.Interior.TintAndShade)
wsobjfc.Cells(i, 6).Interior.TintAndShade = x.Interior.tintandshadse
wsobjfc.Cells(i, 7) =
"'"
&
CStr
(x.Formula1)
i = i + 1
End
If
Next
cnt
wsobjfc.Columns.AutoFit
End
If
Next
Application.Calculation = xlAutomatic
End
Sub