Sub
AuswahlBereich()
Dim
strAktuellerBereich
As
String
strAktuellerBereich = ThisWorkbook.Worksheets(
"Auswahlhilfe"
).Cells(26, 4).Value
If
strAktuellerBereich = ThisWorkbook.Worksheets(
"Auswahlhilfe"
).Cells(29, 5)
Or
strAktuellerBereich =
""
Then
With
ThisWorkbook.Worksheets(
"Automatisationshilfe"
).PivotTables(
"pvtUnfallortAbteilung"
)
.PivotFields(
"Unfallort - Abteilung"
).ClearAllFilters
.PivotCache.Refresh
.PivotFields(
"Unfallort - Abteilung"
).PivotItems(
"(blank)"
).Visible =
False
.PivotFields(
"Unfallort - Bereich"
).CurrentPage =
"(All)"
End
With
With
ThisWorkbook.Worksheets(
"Automatisationshilfe"
)
.PivotTables(
"pvtUnfallortBereich"
).PivotCache.Refresh
.PivotTables(
"pvtKlassifizierung"
).PivotCache.Refresh
.PivotTables(
"pvtKlassifizierung"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage =
"(All)"
.PivotTables(
"pvtKlassifizierung"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtKlassifizierung"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallortArbeitsplatz"
).PivotCache.Refresh
.PivotTables(
"pvtUnfallortArbeitsplatz"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallortArbeitsplatz"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtVerletzungsart"
).PivotCache.Refresh
.PivotTables(
"pvtVerletzungsart"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage =
"(All)"
.PivotTables(
"pvtVerletzungsart"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtVerletzungsart"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitMonat"
).PivotCache.Refresh
.PivotTables(
"pvtUnfallzeitMonat"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitMonat"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitMonat"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitWochentag"
).PivotCache.Refresh
.PivotTables(
"pvtUnfallzeitWochentag"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitWochentag"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitWochentag"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitSchichten"
).PivotCache.Refresh
.PivotTables(
"pvtUnfallzeitSchichten"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitSchichten"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitSchichten"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtKoerperteil"
).PivotCache.Refresh
.PivotTables(
"pvtKoerperteil"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage =
"(All)"
.PivotTables(
"pvtKoerperteil"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtKoerperteil"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallortArbeitsplatzGross"
).PivotCache.Refresh
.PivotTables(
"pvtUnfallortArbeitsplatzGross"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallortArbeitsplatzGross"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
End
With
With
ThisWorkbook.Worksheets(
"Dashboard"
)
.ChartObjects(
"diaUnfallortArbeitsplatz"
).Visible =
False
.Shapes(
"GrUnfallortAbteilung"
).Visible =
False
.Shapes(
"GrUnfallortArbeitsplatz"
).Visible =
False
End
With
Else
With
ThisWorkbook.Worksheets(
"Automatisationshilfe"
).PivotTables(
"pvtUnfallortAbteilung"
)
.PivotFields(
"Unfallort - Abteilung"
).ClearAllFilters
.PivotCache.Refresh
.PivotFields(
"Unfallort - Abteilung"
).PivotItems(
"(blank)"
).Visible =
False
.PivotFields(
"Unfallort - Bereich"
).CurrentPage = strAktuellerBereich
End
With
With
ThisWorkbook.Worksheets(
"Automatisationshilfe"
)
.PivotTables(
"pvtUnfallortBereich"
).PivotCache.Refresh
.PivotTables(
"pvtKlassifizierung"
).PivotCache.Refresh
.PivotTables(
"pvtKlassifizierung"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage = strAktuellerBereich
.PivotTables(
"pvtKlassifizierung"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtKlassifizierung"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallortArbeitsplatz"
).PivotCache.Refresh
.PivotTables(
"pvtUnfallortArbeitsplatz"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage = strAktuellerBereich
.PivotTables(
"pvtUnfallortArbeitsplatz"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtVerletzungsart"
).PivotCache.Refresh
.PivotTables(
"pvtVerletzungsart"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage = strAktuellerBereich
.PivotTables(
"pvtVerletzungsart"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtVerletzungsart"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitMonat"
).PivotCache.Refresh
.PivotTables(
"pvtUnfallzeitMonat"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage = strAktuellerBereich
.PivotTables(
"pvtUnfallzeitMonat"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitMonat"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitWochentag"
).PivotCache.Refresh
.PivotTables(
"pvtUnfallzeitWochentag"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage = strAktuellerBereich
.PivotTables(
"pvtUnfallzeitWochentag"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitWochentag"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitSchichten"
).PivotCache.Refresh
.PivotTables(
"pvtUnfallzeitSchichten"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage = strAktuellerBereich
.PivotTables(
"pvtUnfallzeitSchichten"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallzeitSchichten"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtKoerperteil"
).PivotCache.Refresh
.PivotTables(
"pvtKoerperteil"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage = strAktuellerBereich
.PivotTables(
"pvtKoerperteil"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
.PivotTables(
"pvtKoerperteil"
).PivotFields(
"Unfallort - Arbeitsplatz"
).CurrentPage =
"(All)"
.PivotTables(
"pvtUnfallortArbeitsplatzGross"
).PivotCache.Refresh
.PivotTables(
"pvtUnfallortArbeitsplatzGross"
).PivotFields(
"Unfallort - Bereich"
).CurrentPage = strAktuellerBereich
.PivotTables(
"pvtUnfallortArbeitsplatzGross"
).PivotFields(
"Unfallort - Abteilung"
).CurrentPage =
"(All)"
End
With
With
ThisWorkbook.Worksheets(
"Dashboard"
)
.ChartObjects(
"diaUnfallortArbeitsplatz"
).Visible =
False
.Shapes(
"GrUnfallortAbteilung"
).Visible =
True
.Shapes(
"GrUnfallortArbeitsplatz"
).Visible =
False
End
With
ThisWorkbook.Worksheets(
"Auswahlhilfe"
).Cells(26, 10).Value = 0
ThisWorkbook.Worksheets(
"Auswahlhilfe"
).Cells(26, 10).Value = 0
End
If
End
Sub