View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default hide rows with macro/togglebutton

You don't need a toggle button, just a command button. Just use code like

Rows("10:12").Hidden = Not Rows("10:12").Hidden

--
HTH

Bob Phillips

"huntermcg" wrote
in message ...

hello,

I want to be able to hide and unhide rows by clicking a togglebutton.

So far, I managed to record 2 macro's. 1 to hide the rows and 1 to
unhide the rows. I could make to button's to assign each macro to, but
that would be a lot of work, since I want to add this function to
several places in my worksheet.

A togglebutton would do the trick, but I do not know how to assign the
2 macro's to it. Is there any pro out there who could help me out ?

At least I think the toggle button would be in my humble opinion the
best solution. The only thing is that I have to put the togglebutton
somewhere outside the rows I wish to hide/unhide. If there is a better
solution thinkable I am happy to hear ?

Next to this, I protect my sheets. With the 2 button's I managed to fix
myself I get a 'false' error when I protect my sheet. I am not sure what
I am doing wrong?


--
huntermcg
------------------------------------------------------------------------
huntermcg's Profile:

http://www.excelforum.com/member.php...o&userid=19391
View this thread: http://www.excelforum.com/showthread...hreadid=469683