0

I'm creating an excel dashboard in which I've placed a pivot chart and I want to govern its visibility by the click of a checkbox. I'm not able to identify the pivot chart object on my worksheet and hence can't use the code I can do for any other activeX control like a label. e.g. i can find my label 'lblSales' in the sheet object but I can't find 'pivotChartRC' which is the name of my pivot chart Is there anyway I can do that?

Private Sub checkBoxRC_Click()

If (checkBoxResponseCurve.Value) Then

   Sheet1.lblSales.Visible = True
Else
   Sheet1.lblSales.Visible = False

End If

End Sub
Community
  • 1
  • 1
hbabbar
  • 947
  • 4
  • 15
  • 33
  • 1
    Did you already record a macro in which you just move the pivotchart around a bit? That should give you the ID of the pivotchart – Luuklag Aug 18 '17 at 07:07
  • @Luuklag No, I wasn't aware of this. Thanks!! That helped. New to Macros. Any pointers on how I could change the ID's of these objects. Right now I'd have to do something like Sheet1.Shapes("Chart 20") and so on.. – hbabbar Aug 18 '17 at 07:37
  • You could declare the objects. Just google for declaring shape object. – Luuklag Aug 18 '17 at 07:38

0 Answers0