Radio buttons on rows in Sheet1 to show or hide same rows on Sheet2...?

skinnea

Board Regular
Joined
Mar 15, 2003
Messages
135
Office Version
  1. 365
Platform
  1. Windows
Excel 2010.

I have a sheet that shows all the KPIs my team use to manage the performance our area. There are about 30 of them, they update weekly, and each has its own sparkline graph and a MTD, QTD and YTD Red/Green indicator. They each appear on a separate row.

On a secondary sheet I have all the same KPIs with the same graphs and indicators; it's an exact duplicate. But I want to use this sheet when I'm talking to my boss, and he doesn't need to see all 30+ KPIs - just the important ones.

So what I want to do is have a radio or toggle button alongside every KPI on sheet1 which will control whether that KPI is shown or not (hidden) on sheet2.

That way I can pick the relevant ones to share with my boss, depending on the performance issues I want to communicate (good or otherwise).

Is this possible? I assume it might be macro or VBA related...
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
What is a KPI?

On a secondary sheet I have all the same KPIs with the same graphs and indicators; it's an exact duplicate. But I want to use this sheet when I'm talking to my boss, and he doesn't need to see all 30+ KPIs - just the important ones.
 
Upvote 0
You could use a change event and a Yes/No Validation list. In this case I used column M.

<font face=Calibri><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Worksheet_Change(<SPAN style="color:#00007F">ByVal</SPAN> Target <SPAN style="color:#00007F">As</SPAN> Range)<br><SPAN style="color:#007F00">'   Code goes in the Worksheet specific module</SPAN><br>    <SPAN style="color:#00007F">Dim</SPAN> rng <SPAN style="color:#00007F">As</SPAN> Range<br>    <SPAN style="color:#007F00">'   Set Target Range, i.e. Range("A1, B2, C3"), or Range("A1:B3")</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> rng = Target.Parent.Range("M:M")<br>            <SPAN style="color:#007F00">'   Only look at single cell changes</SPAN><br>            <SPAN style="color:#00007F">If</SPAN> Target.Count > 1 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br>        <SPAN style="color:#007F00">'   Only look at that range</SPAN><br>            <SPAN style="color:#00007F">If</SPAN> Intersect(Target, rng) <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br>        <SPAN style="color:#007F00">'   Action if Condition(s) are met (do your thing here...)</SPAN><br>            <SPAN style="color:#00007F">If</SPAN> UCase(Target.Value) = "YES" <SPAN style="color:#00007F">Then</SPAN><br>                Sheets("Sheet2").Rows(Target.Row).Hidden = <SPAN style="color:#00007F">True</SPAN><br>            <SPAN style="color:#00007F">Else</SPAN><br>                Sheets("Sheet2").Rows(Target.Row).Hidden = <SPAN style="color:#00007F">False</SPAN><br>            <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

Select Yes on sheet 1 and the corresponding row on sheet 2 will be hidden. Delete it and it will be unhidden.

HTH

What is a KPI?

Key Performance Indicator
 
Upvote 0
What is a KPI?

On a secondary sheet I have all the same KPIs with the same graphs and indicators; it's an exact duplicate. But I want to use this sheet when I'm talking to my boss, and he doesn't need to see all 30+ KPIs - just the important ones.

Key Performance Indicator; such as phone calls answered, faults fixed, and so on.
 
Upvote 0
That sounds like the very thing - let me have a go tomorrow and I'll let you know.

One question - in the bit here, where/how am I adding to the blue text to insert my range?

Dim rng As Range
' Set Target Range, i.e. Range("A1, B2, C3"), or Range("A1:B3")
 
Upvote 0
You change the target range here:

Set rng = Target.Parent.Range("M:M")

In this case I defined the target range as all of column M. You could also use an exact range like this:

Set rng = Target.Parent.Range("M5:M35") - This will be more efficient, as you're limiting the target area.

Anything in green with an apostrophe in front of it is a comment, which VBA ignores when it's executed.
 
Upvote 0

Forum statistics

Threads
1,213,554
Messages
6,114,280
Members
448,562
Latest member
Flashbond

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