Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 211
Default Command Button to show/hide a different worksheet

Hello I have several command buttons in a worksheet. each command button
selects a different worksheet. Each worksheet has a different form .
Example
Private Sub CommandButton5_Click()
Worksheets("Application").Activate
End Sub

What I want to do is if the command button "application" is selected to
open the worksheet "application" and the other worksheets to be hidden.
thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 703
Default Command Button to show/hide a different worksheet

Hello

I assume your "MainSheet" should always be visible. Try this:

Private Sub CommandButton5_Click()
For Each sh In ThisWorkbook.Sheets
If sh.Name < "MainSheet" Then
sh.Visible = False
End If
Next
With Worksheets("Application")
.Visible = True
.Activate
End With
End Sub

Regards,
Per


On 22 Apr., 03:42, Marilyn wrote:
Hello * I have several command buttons in a worksheet. each command button
selects a different worksheet. *Each worksheet has a different form .
Example
Private Sub CommandButton5_Click()
Worksheets("Application").Activate
End Sub

What I want to do *is if the command button "application" is selected to
open the worksheet "application" and the other worksheets to be hidden. *
thanks in advance


Reply
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
using a toggle button to show or hide information in several cells hanson Excel Worksheet Functions 3 December 7th 07 10:16 PM
hide or show a series with a button Craig Charts and Charting in Excel 1 December 6th 07 04:36 AM
SUBTOTAL'S SHOW AND HIDE DETAILS BUTTON MISSING Seebu Excel Discussion (Misc queries) 4 October 29th 07 02:27 PM
Use of Forms Command-button on Worksheet Jim May Excel Discussion (Misc queries) 12 November 13th 06 06:08 PM
Command Button to Hide/Unhide Rows Bea Excel Discussion (Misc queries) 4 March 16th 06 03:21 PM


All times are GMT +1. The time now is 10:17 PM.

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

About Us

"It's about Microsoft Excel"