PC Review


Reply
Thread Tools Rate Thread

How do I set a macro to unhide a worksheet and stay on it?

 
 
moez77
Guest
Posts: n/a
 
      6th Nov 2009
I am trying to create a form on Excel (2007) that will contain individual
form control buttons for every worksheet in the workbook. My goal is to just
display one sheet with a control button with all the options for the actual
worksheets. Once the user selects the button for the worksheet he would like
to see that worksheet should unhide and display. I got the macro recorded to
do so but it then switches back to the form sheet. I would like for it to
remain on the newly displayed worksheet.

 
Reply With Quote
 
 
 
 
Barb Reinhardt
Guest
Posts: n/a
 
      6th Nov 2009
Show us what you have and we can modify. (it's not much, I'm sure)

"moez77" wrote:

> I am trying to create a form on Excel (2007) that will contain individual
> form control buttons for every worksheet in the workbook. My goal is to just
> display one sheet with a control button with all the options for the actual
> worksheets. Once the user selects the button for the worksheet he would like
> to see that worksheet should unhide and display. I got the macro recorded to
> do so but it then switches back to the form sheet. I would like for it to
> remain on the newly displayed worksheet.
>

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      7th Nov 2009
Assuming sheet 2 is hidden, the something like:

Private Sub CommandButton1_Click()
Sheets("Sheet2").Visible = True
Sheets("Sheet2").Activate
End Sub



"moez77" <(E-Mail Removed)> wrote in message
news:97E33CF9-EA50-46E7-B28C-(E-Mail Removed)...
>I am trying to create a form on Excel (2007) that will contain individual
> form control buttons for every worksheet in the workbook. My goal is to
> just
> display one sheet with a control button with all the options for the
> actual
> worksheets. Once the user selects the button for the worksheet he would
> like
> to see that worksheet should unhide and display. I got the macro recorded
> to
> do so but it then switches back to the form sheet. I would like for it to
> remain on the newly displayed worksheet.
>



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      7th Nov 2009
If the button is on a UserForm, modify the code to:

Private Sub CommandButton1_Click()
Sheets("Sheet2").Visible = True
Sheets("Sheet2").Activate
Unload Me
End Sub

This will close the UserForm and leave the Active sheet on screen.

"moez77" <(E-Mail Removed)> wrote in message
news:97E33CF9-EA50-46E7-B28C-(E-Mail Removed)...
>I am trying to create a form on Excel (2007) that will contain individual
> form control buttons for every worksheet in the workbook. My goal is to
> just
> display one sheet with a control button with all the options for the
> actual
> worksheets. Once the user selects the button for the worksheet he would
> like
> to see that worksheet should unhide and display. I got the macro recorded
> to
> do so but it then switches back to the form sheet. I would like for it to
> remain on the newly displayed worksheet.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unhide macro worksheet JoeF Microsoft Excel Misc 2 4th Mar 2010 09:10 PM
why worksheet can't unhide? SYSTEM ERROR Microsoft Excel Crashes 1 18th May 2008 03:01 AM
unhide a row in a worksheet using vba Roxy Microsoft Excel Misc 2 1st Feb 2008 12:41 AM
how do i unhide a worksheet in excel 2003? unhide tab don't work =?Utf-8?B?bWlrZWtlYXQ=?= Microsoft Excel Misc 2 6th Mar 2006 03:36 AM
Worksheet unhide csdo Microsoft Excel Programming 1 15th Aug 2003 03:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:39 PM.