Option
Explicit
Public
Sub
Button_Click()
With
ActiveSheet.Buttons(Application.Caller)
Select
Case
.Caption
Case
Is
=
"Diagramm3"
.Caption =
"Diagramm1"
.Font.Color = vbRed
Call
prcChartsVisibility(
True
,
False
,
False
)
Case
Is
=
"Diagramm2"
.Caption =
"Diagramm3"
.Font.Color = vbMagenta
Call
prcChartsVisibility(
False
,
False
,
True
)
Case
Else
.Caption =
"Diagramm2"
.Font.Color = vbBlue
Call
prcChartsVisibility(
False
,
True
,
False
)
End
Select
End
With
End
Sub
Private
Sub
prcChartsVisibility(
ParamArray
ppavntArgs()
As
Variant
)
With
ActiveSheet
.ChartObjects(1).Visible = ppavntArgs(0)
.ChartObjects(2).Visible = ppavntArgs(1)
.ChartObjects(3).Visible = ppavntArgs(2)
End
With
End
Sub