ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hiding worksheets programmatically (https://www.excelbanter.com/excel-programming/406476-hiding-worksheets-programmatically.html)

johne

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

JLGWhiz

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


johne

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


Gary Keramidas[_2_]

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



scott[_12_]

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


JLGWhiz

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



All times are GMT +1. The time now is 06:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com