Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I set a macro to unhide a worksheet and stay on it?

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default How do I set a macro to unhide a worksheet and stay on it?

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default How do I set a macro to unhide a worksheet and stay on it?

Assuming sheet 2 is hidden, the something like:

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



"moez77" wrote in message
...
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.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default How do I set a macro to unhide a worksheet and stay on it?

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" wrote in message
...
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
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
Unhide macro worksheet JoeF Excel Discussion (Misc queries) 2 March 4th 10 09:10 PM
Copy a worksheet and ensure range names stay local Darren Hill[_4_] Excel Programming 0 April 5th 07 08:21 AM
how do i unhide a worksheet in excel 2003? unhide tab don't work mikekeat Excel Discussion (Misc queries) 2 March 6th 06 03:36 AM
columns and rows on my worksheet will not stay resized vulcan88 Excel Worksheet Functions 0 March 15th 05 11:07 PM
combobox on worksheet won't stay in one place MVM Excel Programming 2 February 25th 05 12:19 AM


All times are GMT +1. The time now is 07:45 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"