Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message oups.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" wrote in message ... 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
HI Ron,
Yes, I've been away for a while, but hoping to get back into the swing of things! Peter. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I update all worksheets at startup? | Excel Worksheet Functions | |||
Hide/Show some worksheets | Excel Discussion (Misc queries) | |||
Excel startup and named worksheets | Excel Discussion (Misc queries) | |||
How to hide worksheets | New Users to Excel | |||
Hide and unhide worksheets | Excel Programming |