ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Toggle Button (https://www.excelbanter.com/excel-discussion-misc-queries/43410-toggle-button.html)

Dave_2k5

Toggle Button
 

Hi all,

I am looking a putting a VB command button on one of my sheets, which
when pressed once it does one thing, then when pressed again it does
something different.

e.g. when pressed first time it hides a range of rows, when pressed
again it unhides them.

Hope you can help

Dave


--
Dave_2k5
------------------------------------------------------------------------
Dave_2k5's Profile: http://www.excelforum.com/member.php...o&userid=19667
View this thread: http://www.excelforum.com/showthread...hreadid=401062


dominicb


You will find an answer in your other post.

Please do not post to multiple categories - your question will get seen
whichever category it is in.

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=401062


Bob Phillips

Here is a macro that you can assign to a forms toolbar button

Sub myMacro()
Static fOn As Boolean

fOn = Not fOn
Rows("1:3").Hidden = fOn

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dave_2k5" wrote in
message ...

Hi all,

I am looking a putting a VB command button on one of my sheets, which
when pressed once it does one thing, then when pressed again it does
something different.

e.g. when pressed first time it hides a range of rows, when pressed
again it unhides them.

Hope you can help

Dave


--
Dave_2k5
------------------------------------------------------------------------
Dave_2k5's Profile:

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





All times are GMT +1. The time now is 04:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com