Check Boxes to hide chart data

txgodfather

New Member
Joined
Mar 12, 2009
Messages
4
I am trying to create a dashboard that will allow me to monitor my monthly sales, expenses, and profit. I have created three different line charts (one for sales, one for expenses, and one for profit). On each chart, each line represents a year (2003 is one line, 2004 another, etc.). Now I have three charts that are way too cluttered. I want to create check boxes for each year that will hide that years data when unchecked. Every year's data is on its own sheet in this workbook. I am having trouble writing the code for this. I saw this code on the forums, but I don't know how to assign a different sheet name.

Sub Hide()
Rows(4).EntireRow.Hidden = True
ActiveSheet.Shapes("CheckBox1").Visible = False
End Sub

Sub UnHide()
Rows(4).EntireRow.Hidden = False
ActiveSheet.Shapes("CheckBox1").Visible = True
End Sub

Any help is greatly appreciated.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You mean making another sheet active? Try something like this maybe??
Code:
Sheets("SheetNameHere").Rows(4).EntireRow.Hidden = True

Not even sure if that is the correct way but makes sense to me.
 
Upvote 0

Forum statistics

Threads
1,215,004
Messages
6,122,656
Members
449,091
Latest member
peppernaut

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