Button to hide and unhide rows

singingsister

Board Regular
Joined
Jun 13, 2006
Messages
145
Hi guys,

I used to know how to do this but have forgotten!

I want to have a toggle button to hide and unhide a selection of rows (in this case F-P).

I've remembered how to record a macro and create a button but this only hides the rows. I want to be able to click the same button again to unhide the rows.

Can you advise me how?

Sarah

PS - Excel 2010
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Right click any Toolbar and click Control Toolbox. Click the Toggle Button icon and click and drag on your worksheet to position and size it. Right click the ToggleButton and choose View Code. Overwrite the procedure stub with the code I posted and press Alt+F11 to return to your worksheet. Click the button at top left of the Control Toolbox to exit Design Mode and click the ToggleButton to try it out.
 
Upvote 0
Right click any Toolbar and click Control Toolbox. Click the Toggle Button icon and click and drag on your worksheet to position and size it. Right click the ToggleButton and choose View Code. Overwrite the procedure stub with the code I posted and press Alt+F11 to return to your worksheet. Click the button at top left of the Control Toolbox to exit Design Mode and click the ToggleButton to try it out.

OK I'm really being thick. I'm clicking any toolbar and I don't see Control Toolbox. I'm using Excel 2010 and have added the "developer" toolbar to the ribbon

I know how to find the buttons under the developer toolbar but can't see one labelled toggle button?
 
Upvote 0
On the Developer tab click Insert in the Controls group. In the ActiveX Controls group it's second from the right on the second row.
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

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