Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Using a Macro to look at Hidden Sheet

I have several sheets (sheet A) that correspond to another sheet (sheet B).
Sheet B needs to be hidden, however I am trying to record a marco that when
you click on the button it will take you to the hidden sheet.

I also need it so that when you're in the sheet (or if it's simpler, when
you leave the sheet) it remains hidden and the tab doesn't show at the bottom.

Can anybody help?!?

Thanks
alice
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default Using a Macro to look at Hidden Sheet

Create a button and use the following code to unhide the sheet..

Sub HideSheetB ()
Sheets("sheet B").visible = True
End Sub


To have it hidden when you leave the sheet, right click on the sheet and
select View Code. Paste this code.

Private Sub Worksheet_Deactivate()
Sheets("sheet B").Visible = False
End Sub


HTH,
Paul

"alice" wrote in message
...
I have several sheets (sheet A) that correspond to another sheet (sheet B).
Sheet B needs to be hidden, however I am trying to record a marco that
when
you click on the button it will take you to the hidden sheet.

I also need it so that when you're in the sheet (or if it's simpler, when
you leave the sheet) it remains hidden and the tab doesn't show at the
bottom.

Can anybody help?!?

Thanks
alice



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Using a Macro to look at Hidden Sheet

I'm a little confused as to how the first part should look. Currently it
looks as below but is telling me there's an error.

Sub HideCHM()
Sheets("C H M").Visible = True
End Sub


However when you first go to paste it in it has the below there. Does this
need to stay?

Sub Button12_Click()

End Sub


Thanks

"PCLIVE" wrote:

Create a button and use the following code to unhide the sheet..

Sub HideSheetB ()
Sheets("sheet B").visible = True
End Sub


To have it hidden when you leave the sheet, right click on the sheet and
select View Code. Paste this code.

Private Sub Worksheet_Deactivate()
Sheets("sheet B").Visible = False
End Sub


HTH,
Paul

"alice" wrote in message
...
I have several sheets (sheet A) that correspond to another sheet (sheet B).
Sheet B needs to be hidden, however I am trying to record a marco that
when
you click on the button it will take you to the hidden sheet.

I also need it so that when you're in the sheet (or if it's simpler, when
you leave the sheet) it remains hidden and the tab doesn't show at the
bottom.

Can anybody help?!?

Thanks
alice




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default Using a Macro to look at Hidden Sheet

Paste the one line of code between the 'Sub Button12_Click()' and 'End Sub'.
It should look like this.

Sub Button12_Click()
Sheets("C H M").Visible = True
End Sub

HTH,
Paul


"alice" wrote in message
...
I'm a little confused as to how the first part should look. Currently it
looks as below but is telling me there's an error.

Sub HideCHM()
Sheets("C H M").Visible = True
End Sub


However when you first go to paste it in it has the below there. Does
this
need to stay?

Sub Button12_Click()

End Sub


Thanks

"PCLIVE" wrote:

Create a button and use the following code to unhide the sheet..

Sub HideSheetB ()
Sheets("sheet B").visible = True
End Sub


To have it hidden when you leave the sheet, right click on the sheet and
select View Code. Paste this code.

Private Sub Worksheet_Deactivate()
Sheets("sheet B").Visible = False
End Sub


HTH,
Paul

"alice" wrote in message
...
I have several sheets (sheet A) that correspond to another sheet (sheet
B).
Sheet B needs to be hidden, however I am trying to record a marco that
when
you click on the button it will take you to the hidden sheet.

I also need it so that when you're in the sheet (or if it's simpler,
when
you leave the sheet) it remains hidden and the tab doesn't show at the
bottom.

Can anybody help?!?

Thanks
alice






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Using a Macro to look at Hidden Sheet

Eekk I'm being a pain I know!

The code for the button doesn't seem to be working. I've put in the below
and it comes up with the following:

Run time error '9':

Subscript out of range





"PCLIVE" wrote:

Paste the one line of code between the 'Sub Button12_Click()' and 'End Sub'.
It should look like this.

Sub Button12_Click()
Sheets("C H M").Visible = True
End Sub

HTH,
Paul


"alice" wrote in message
...
I'm a little confused as to how the first part should look. Currently it
looks as below but is telling me there's an error.

Sub HideCHM()
Sheets("C H M").Visible = True
End Sub


However when you first go to paste it in it has the below there. Does
this
need to stay?

Sub Button12_Click()

End Sub


Thanks

"PCLIVE" wrote:

Create a button and use the following code to unhide the sheet..

Sub HideSheetB ()
Sheets("sheet B").visible = True
End Sub


To have it hidden when you leave the sheet, right click on the sheet and
select View Code. Paste this code.

Private Sub Worksheet_Deactivate()
Sheets("sheet B").Visible = False
End Sub


HTH,
Paul

"alice" wrote in message
...
I have several sheets (sheet A) that correspond to another sheet (sheet
B).
Sheet B needs to be hidden, however I am trying to record a marco that
when
you click on the button it will take you to the hidden sheet.

I also need it so that when you're in the sheet (or if it's simpler,
when
you leave the sheet) it remains hidden and the tab doesn't show at the
bottom.

Can anybody help?!?

Thanks
alice








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Using a Macro to look at Hidden Sheet

PCLive tried to hide a sheet named "C H M". If you don't have a sheet with that
name, you'll get that error.

Try changing the "C H M" to the name of the sheet to hide.

Remember that at least one sheet has to be visible, too.

alice wrote:

Eekk I'm being a pain I know!

The code for the button doesn't seem to be working. I've put in the below
and it comes up with the following:

Run time error '9':

Subscript out of range

"PCLIVE" wrote:

Paste the one line of code between the 'Sub Button12_Click()' and 'End Sub'.
It should look like this.

Sub Button12_Click()
Sheets("C H M").Visible = True
End Sub

HTH,
Paul


"alice" wrote in message
...
I'm a little confused as to how the first part should look. Currently it
looks as below but is telling me there's an error.

Sub HideCHM()
Sheets("C H M").Visible = True
End Sub


However when you first go to paste it in it has the below there. Does
this
need to stay?

Sub Button12_Click()

End Sub


Thanks

"PCLIVE" wrote:

Create a button and use the following code to unhide the sheet..

Sub HideSheetB ()
Sheets("sheet B").visible = True
End Sub


To have it hidden when you leave the sheet, right click on the sheet and
select View Code. Paste this code.

Private Sub Worksheet_Deactivate()
Sheets("sheet B").Visible = False
End Sub


HTH,
Paul

"alice" wrote in message
...
I have several sheets (sheet A) that correspond to another sheet (sheet
B).
Sheet B needs to be hidden, however I am trying to record a marco that
when
you click on the button it will take you to the hidden sheet.

I also need it so that when you're in the sheet (or if it's simpler,
when
you leave the sheet) it remains hidden and the tab doesn't show at the
bottom.

Can anybody help?!?

Thanks
alice







--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default Using a Macro to look at Hidden Sheet

In addition to Dave's message, be sure that you use the same context in your
code to match the actual sheet name. You may also want to activate the
sheet after the button is pressed.

Sub Button12_Click()
Sheets("C H M").Visible = True
Sheets("C H M").Activate
End Sub


"Dave Peterson" wrote in message
...
PCLive tried to hide a sheet named "C H M". If you don't have a sheet
with that
name, you'll get that error.

Try changing the "C H M" to the name of the sheet to hide.

Remember that at least one sheet has to be visible, too.

alice wrote:

Eekk I'm being a pain I know!

The code for the button doesn't seem to be working. I've put in the
below
and it comes up with the following:

Run time error '9':

Subscript out of range

"PCLIVE" wrote:

Paste the one line of code between the 'Sub Button12_Click()' and 'End
Sub'.
It should look like this.

Sub Button12_Click()
Sheets("C H M").Visible = True
End Sub

HTH,
Paul


"alice" wrote in message
...
I'm a little confused as to how the first part should look.
Currently it
looks as below but is telling me there's an error.

Sub HideCHM()
Sheets("C H M").Visible = True
End Sub


However when you first go to paste it in it has the below there.
Does
this
need to stay?

Sub Button12_Click()

End Sub


Thanks

"PCLIVE" wrote:

Create a button and use the following code to unhide the sheet..

Sub HideSheetB ()
Sheets("sheet B").visible = True
End Sub


To have it hidden when you leave the sheet, right click on the sheet
and
select View Code. Paste this code.

Private Sub Worksheet_Deactivate()
Sheets("sheet B").Visible = False
End Sub


HTH,
Paul

"alice" wrote in message
...
I have several sheets (sheet A) that correspond to another sheet
(sheet
B).
Sheet B needs to be hidden, however I am trying to record a marco
that
when
you click on the button it will take you to the hidden sheet.

I also need it so that when you're in the sheet (or if it's
simpler,
when
you leave the sheet) it remains hidden and the tab doesn't show at
the
bottom.

Can anybody help?!?

Thanks
alice







--

Dave Peterson



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Using a Macro to look at Hidden Sheet

Yay it's working now that the Activate is there.

thanks
alice x

"PCLIVE" wrote:

In addition to Dave's message, be sure that you use the same context in your
code to match the actual sheet name. You may also want to activate the
sheet after the button is pressed.

Sub Button12_Click()
Sheets("C H M").Visible = True
Sheets("C H M").Activate
End Sub


"Dave Peterson" wrote in message
...
PCLive tried to hide a sheet named "C H M". If you don't have a sheet
with that
name, you'll get that error.

Try changing the "C H M" to the name of the sheet to hide.

Remember that at least one sheet has to be visible, too.

alice wrote:

Eekk I'm being a pain I know!

The code for the button doesn't seem to be working. I've put in the
below
and it comes up with the following:

Run time error '9':

Subscript out of range

"PCLIVE" wrote:

Paste the one line of code between the 'Sub Button12_Click()' and 'End
Sub'.
It should look like this.

Sub Button12_Click()
Sheets("C H M").Visible = True
End Sub

HTH,
Paul


"alice" wrote in message
...
I'm a little confused as to how the first part should look.
Currently it
looks as below but is telling me there's an error.

Sub HideCHM()
Sheets("C H M").Visible = True
End Sub


However when you first go to paste it in it has the below there.
Does
this
need to stay?

Sub Button12_Click()

End Sub


Thanks

"PCLIVE" wrote:

Create a button and use the following code to unhide the sheet..

Sub HideSheetB ()
Sheets("sheet B").visible = True
End Sub


To have it hidden when you leave the sheet, right click on the sheet
and
select View Code. Paste this code.

Private Sub Worksheet_Deactivate()
Sheets("sheet B").Visible = False
End Sub


HTH,
Paul

"alice" wrote in message
...
I have several sheets (sheet A) that correspond to another sheet
(sheet
B).
Sheet B needs to be hidden, however I am trying to record a marco
that
when
you click on the button it will take you to the hidden sheet.

I also need it so that when you're in the sheet (or if it's
simpler,
when
you leave the sheet) it remains hidden and the tab doesn't show at
the
bottom.

Can anybody help?!?

Thanks
alice







--

Dave Peterson




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
hidden macro? [email protected] Excel Discussion (Misc queries) 2 January 2nd 07 08:09 PM
Macro Error When Connecting to Hidden Sheet Wuddus Excel Discussion (Misc queries) 5 August 3rd 06 03:34 PM
I need my Hidden Rows to stay hidden when I print the sheet. Rosaliewoo Excel Discussion (Misc queries) 2 July 20th 06 07:51 PM
Hidden Macro Remington Excel Discussion (Misc queries) 2 June 9th 06 09:47 PM
Can a macro format a hidden sheet? Robert Excel Discussion (Misc queries) 1 February 9th 05 06:13 PM


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

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"