LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 318
Default command button commands to much

Hello I created 15 command buttons below is a sample of the code for
three of them
Private Sub CommandButton1_Click()
Dim myRng As Range

Set myRng = Me.Range("a35:V64")

myRng.EntireRow.Hidden = Not (myRng(1).EntireRow.Hidden)

End Sub

Private Sub CommandButton2_Click()
Dim myRng As Range

Set myRng = Me.Range("a65:V96")

myRng.EntireRow.Hidden = Not (myRng(1).EntireRow.Hidden)
End Sub

Private Sub CommandButton3_Click()
Dim myRng As Range

Set myRng = Me.Range("a97:V129")

myRng.EntireRow.Hidden = Not (myRng(1).EntireRow.Hidden)
End Sub

So if a user clicks one of the command buttons it opens the section if they
click the second command button it opens the second section but the first
section remains open - (unless the first command button is clicked)

Only one section should be open at a time .
How can I correct this
thanks in advance
Is there a way that if th

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command button AOU Excel Discussion (Misc queries) 2 September 14th 07 06:32 PM
Command Button inspirz Excel Discussion (Misc queries) 1 March 29th 07 06:38 PM
Command Button Steved Excel Worksheet Functions 2 February 19th 06 11:01 PM
command button Hellboy Excel Discussion (Misc queries) 0 November 3rd 05 02:51 PM
Using a command button to add Chance Excel Discussion (Misc queries) 5 October 21st 05 08:08 PM


All times are GMT +1. The time now is 02:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"