How do I hide a chart (with VBA?)

Jed Shields

Active Member
Joined
Sep 7, 2011
Messages
283
Office Version
  1. 365
Platform
  1. Windows
Hi guys,

I have a dashboard with 6 charts, one for each portfolio manager of a particular branch. Some branches have the maximum 6 PMs, some only have 1. I select the branch using a dropdown list and the charts update for the relevant PMs. In the branches where I have less than 6 PMs, how can I hide the charts that will appear blank?

Cheers,

Jed.
 
Sorted the colours!

Code:
ActiveChart.Axes(xlValue).Select
    ActiveChart.Axes(xlValue).TickLabels.Font.Color = RGB(255, 255, 255)
    ActiveChart.Axes(xlCategory).Select
    ActiveChart.Axes(xlCategory).TickLabels.Font.Color = RGB(255, 255, 255)

Thanks for the pointers guys, I got there eventually :)
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Glad you solved it. Also, try
Rich (BB code):
ChartObjects("chart 1").Visible = False
To delete the charts you could use
Rich (BB code):
ActiveSheet.ChartObjects.Delete
To add charts
Rich (BB code):
Charts.Add
 
Upvote 0
Code:
Sub HideChart()

ChartObjects("chart 9").Visible = False

End Sub
Lol ... that's a much simpler solution! Just tried it and it works :)
 
Upvote 0
Nice. I dont use charts a whole heck of a lot. I knew I had a project where I was hiding/showing charts, so I opened that up when I got to work to find out how I was doing it.
 
Upvote 0

Forum statistics

Threads
1,214,572
Messages
6,120,306
Members
448,955
Latest member
Dreamz high

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top