Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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=401061 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Good morning Dave_2k5 Why not set up a check box from the control toolbox toolbar. Once you've drawn it on screen double click on it and paste the code below into the window that opens. Close the window to return to Excel and on the Control Toolbox bar select Design Mode (top left) to set the checkbox. The code shown assumes that your checkbox will be called Checkbox1 and that you want to hide rows 10 to 15 inclusive. Private Sub CheckBox1_Click() If CheckBox1.Value = True Then Rows("10:15").EntireRow.Hidden = True Else Rows("10:15").EntireRow.Hidden = False End If End Sub HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=401061 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I would do that......But want it to be a button not a checkbox!! Cheers Anyway 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=401061 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Dave If it HAS to be a button then have a look in the control toolbox - there is a toggle button. Don't use the forms toolbar because there isn't one there. HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=401061 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Toggle Button | Excel Worksheet Functions | |||
Need to Use 1 Button to toggle On or Off | Excel Discussion (Misc queries) | |||
Toggle Button | Excel Discussion (Misc queries) | |||
Toggle Button | Excel Discussion (Misc queries) | |||
Adding .xla button for Toggle Calculation Button | Excel Programming |