I'm new to VBA in excel, and I'm trying to put together a dashboard for my leadership to view...most of my background is in database query languages and not programming in this sense. I'm trying to build three buttons in excel: Overview, Direct, Indirect are the names to be exact. When I click Overview, I want my "Dashboard" to show all of the metrics I used in my overview calculations (charts, numbers, etc). If I click it again, I want it to hide them. The same with the other two buttons, If I click "overview" and my dashboard view is all of my overview metrics and graphs, and I click "Direct" I want all of my metrics, graphs to show my "Direct" metrics. The same goes for Indirect. So far I have one macro, it hides all objects (shapes, charts) in my active worksheet, but not the metrics (numbers) in the cells. It also hides the button that I assigned the macro too, so I can't unhide everything unless I open the VBA editor! I want each of my 3 "main" buttons to not hide when I click any of them, just my charts and metrics, and upon a second click of the button unhide.
Here's my sample code so far:
Sub HideEachShape()
Dim sObject As Shape
For Each sObject In ActiveSheet.Shapes
sObject.Visible = False
Next
End Sub
Pretty basic I know, but I'm new to this.