Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default hiding worksheets programmatically

I have an inherited workbook that when it is all done running the scenarios,
etc, there are a extra sheets. These have the standard "Sheet" + number on
the tab while those reviewed and needed are actually named. I would like to
hide these unused sheets at the end of the running process. But I am at a
loss of how that would be accomplished, so I seek help from the group.
Thanks.
.... John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default hiding worksheets programmatically

Click on the sheet tab to activate it, then

FormatSheetHide


"JohnE" wrote:

I have an inherited workbook that when it is all done running the scenarios,
etc, there are a extra sheets. These have the standard "Sheet" + number on
the tab while those reviewed and needed are actually named. I would like to
hide these unused sheets at the end of the running process. But I am at a
loss of how that would be accomplished, so I seek help from the group.
Thanks.
... John

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default hiding worksheets programmatically

That I know. I need to use code to hide them. The number of the sheets will
vary from run to run.
.... John


"JLGWhiz" wrote:

Click on the sheet tab to activate it, then

FormatSheetHide


"JohnE" wrote:

I have an inherited workbook that when it is all done running the scenarios,
etc, there are a extra sheets. These have the standard "Sheet" + number on
the tab while those reviewed and needed are actually named. I would like to
hide these unused sheets at the end of the running process. But I am at a
loss of how that would be accomplished, so I seek help from the group.
Thanks.
... John

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default hiding worksheets programmatically

you can try these

worksheets("Sheet1").visible = false
worksheets("Sheet1").visible = true
worksheets("Sheet1").visible = xlveryhidden

--

Gary


"JohnE" wrote in message
...
I have an inherited workbook that when it is all done running the
scenarios,
etc, there are a extra sheets. These have the standard "Sheet" + number
on
the tab while those reviewed and needed are actually named. I would like
to
hide these unused sheets at the end of the running process. But I am at a
loss of how that would be accomplished, so I seek help from the group.
Thanks.
... John


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default hiding worksheets programmatically

Will the sheets you are not hiding always have similar
characteristics? Do these sheets have anything you need? You might
delete them too.

Perhaps you could adapt this

Sub HideSheets()
For Each ws In Worksheets
If Left(ws.Name, 5) = "Sheet" Then ws.Visible = False
Next ws
End Sub

Scott
On Thu, 21 Feb 2008 12:56:02 -0800, JohnE
wrote:

I have an inherited workbook that when it is all done running the scenarios,
etc, there are a extra sheets. These have the standard "Sheet" + number on
the tab while those reviewed and needed are actually named. I would like to
hide these unused sheets at the end of the running process. But I am at a
loss of how that would be accomplished, so I seek help from the group.
Thanks.
... John



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default hiding worksheets programmatically

You said these were extra sheets. I assumed they were unnecessary and you
just wanted them out of the way. If they were created by the macro during
the execution and are used somewhere along the line, then you will need to
think about how you are going to handle this situation. Will the macro
create new sheets each time or will you just unhide the sheets. Since you
did not specify how the extra sheets came into existence and what, if any,
significance they have in the execution of the macro, maybe Gary's posting
offers the best information.

"JohnE" wrote:

That I know. I need to use code to hide them. The number of the sheets will
vary from run to run.
... John


"JLGWhiz" wrote:

Click on the sheet tab to activate it, then

FormatSheetHide


"JohnE" wrote:

I have an inherited workbook that when it is all done running the scenarios,
etc, there are a extra sheets. These have the standard "Sheet" + number on
the tab while those reviewed and needed are actually named. I would like to
hide these unused sheets at the end of the running process. But I am at a
loss of how that would be accomplished, so I seek help from the group.
Thanks.
... John

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
Setting a Worksheets Codename to a variable programmatically Turk[_3_] Excel Programming 3 October 19th 06 01:25 PM
Hiding worksheets tkaplan[_4_] Excel Programming 2 August 30th 05 03:59 PM
Retrieving list of worksheets programmatically Scott Bass Excel Programming 3 July 2nd 05 01:36 PM
Hiding rows programmatically tjtjjtjt Excel Programming 2 June 18th 04 04:02 AM
Programmatically addressing worksheets - painfully stupid question Chip Pearson Excel Programming 1 September 8th 03 03:02 PM


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