Hello -
I need to hide sheets when my app first begins (all except one). What is
the best way to do this? I don't want to hide each one individually.
Also, I'm assuming I would put the code in ThisWorkbook.
Any help is appreciated!
--
Sandy
Hello -
I need to hide sheets when my app first begins (all except one). What is
the best way to do this? I don't want to hide each one individually.
Also, I'm assuming I would put the code in ThisWorkbook.
Any help is appreciated!
--
Sandy
Sandy,
Put the following code in the ThisWorkbook code module:
Private Sub Workbook_Open()
Dim WS As Worksheet
For Each WS In Worksheets
If WS.Name <> "The One You Don't Want To Hide" Then
WS.Visible = xlSheetHidden
End If
Next WS
End Sub
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"Sandy" <Sandy@discussions.microsoft.com> wrote in message
news:DBBF7FBB-7297-47D6-8F47-6281A703DF17@microsoft.com...
> Hello -
>
> I need to hide sheets when my app first begins (all except
> one). What is
> the best way to do this? I don't want to hide each one
> individually.
>
> Also, I'm assuming I would put the code in ThisWorkbook.
>
> Any help is appreciated!
> --
> Sandy
Sandy,
If you are hiding to prevent people seeing your data, maybe you should
save the workbook with all but one sheet hidden, and then unhide the
other sheets when the workbook is opened. This way, if a user disables
macros they will only see the one sheet.
You can use Chips code and change one line:
WS.Visible = true
Thats all, Good Luck!
Peter Noneley
Cardiff
Wales
UK
Chip Pearson wrote:
> Sandy,
>
> Put the following code in the ThisWorkbook code module:
>
> Private Sub Workbook_Open()
> Dim WS As Worksheet
> For Each WS In Worksheets
> If WS.Name <> "The One You Don't Want To Hide" Then
> WS.Visible = xlSheetHidden
> End If
> Next WS
> End Sub
>
>
> --
> Cordially,
> Chip Pearson
> Microsoft MVP - Excel
> Pearson Software Consulting, LLC
> www.cpearson.com
>
>
>
> "Sandy" <Sandy@discussions.microsoft.com> wrote in message
> news:DBBF7FBB-7297-47D6-8F47-6281A703DF17@microsoft.com...
> > Hello -
> >
> > I need to hide sheets when my app first begins (all except
> > one). What is
> > the best way to do this? I don't want to hide each one
> > individually.
> >
> > Also, I'm assuming I would put the code in ThisWorkbook.
> >
> > Any help is appreciated!
> > --
> > Sandy
Hi Peter
Good to see you in the newsgroup
I hope you are OK
If you have a update of your "Excel Function Dictionary" or if
your site is working again let me know and I change the link.
http://www.rondebruin.nl/id.htm
Bottom of the page
Good night
--
Regards Ron de Bruin
http://www.rondebruin.nl
"Peter Noneley" <xlfdic@hotmail.com> wrote in message news:1126474340.491363.219190@g43g2000cwa.googlegroups.com...
> Sandy,
>
> If you are hiding to prevent people seeing your data, maybe you should
> save the workbook with all but one sheet hidden, and then unhide the
> other sheets when the workbook is opened. This way, if a user disables
> macros they will only see the one sheet.
>
> You can use Chips code and change one line:
>
> WS.Visible = true
>
> Thats all, Good Luck!
>
> Peter Noneley
> Cardiff
> Wales
> UK
>
> Chip Pearson wrote:
>> Sandy,
>>
>> Put the following code in the ThisWorkbook code module:
>>
>> Private Sub Workbook_Open()
>> Dim WS As Worksheet
>> For Each WS In Worksheets
>> If WS.Name <> "The One You Don't Want To Hide" Then
>> WS.Visible = xlSheetHidden
>> End If
>> Next WS
>> End Sub
>>
>>
>> --
>> Cordially,
>> Chip Pearson
>> Microsoft MVP - Excel
>> Pearson Software Consulting, LLC
>> www.cpearson.com
>>
>>
>>
>> "Sandy" <Sandy@discussions.microsoft.com> wrote in message
>> news:DBBF7FBB-7297-47D6-8F47-6281A703DF17@microsoft.com...
>> > Hello -
>> >
>> > I need to hide sheets when my app first begins (all except
>> > one). What is
>> > the best way to do this? I don't want to hide each one
>> > individually.
>> >
>> > Also, I'm assuming I would put the code in ThisWorkbook.
>> >
>> > Any help is appreciated!
>> > --
>> > Sandy
>
HI Ron,
Yes, I've been away for a while, but hoping to get back into the swing
of things!
Peter.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks