Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
Can you make sheets invisible and if so, how can you recall them [make them
visible again]? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
To hide a sheet, go to the Format menu, choose Worksheet, and then select Hide. To make a hidden sheet visible, go to the Format menu, choose Worksheet, and then select UnHide. You can do this with code in a manner similar to the following: ' hide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlHidden ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden ' unhide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlVisible ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible ' hide all but active sheet Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(ActiveSheet.Name, WS.Name, vbBinaryCompare) < 0 Then WS.Visible = xlSheetHidden End If Next WS ' unhide all sheets For Each WS In ThisWorkbook.Worksheets WS.Visible = xlSheetVisible Next WS When the Visible property is xlVisible, the sheet is visible. When the Visible property is xlHidden, the sheet is hidden but can be made visible from the Format menu. When the Visible property is xlVeryHidden, the sheet is hidden and cannot be made visible from the Format menu. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 29 Nov 2008 07:46:01 -0800, Abdul wrote: Can you make sheets invisible and if so, how can you recall them [make them visible again]? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
Hi,
One point - you can't hide all of the sheets in a workbook, one must be visible. Although you can hide the workbook. In 2007 the command is Home, Format, Hide & Unhide, Hide Sheet. If this helps, please click the Yes button Cheers, Shane Devenshire "Abdul" wrote: Can you make sheets invisible and if so, how can you recall them [make them visible again]? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
Hi Chip
I installed the codes for Very Hidden and works fine but to unhide I get an error " Unable to set the visible property of the worksheet class" this error is in VB editor runing the macro with F5 in the worksheet I only get a Popup window with the number 400 nothing else Regards John There is no failure except in no longer trying. Elbert Hubbard "Chip Pearson" wrote in message ... To hide a sheet, go to the Format menu, choose Worksheet, and then select Hide. To make a hidden sheet visible, go to the Format menu, choose Worksheet, and then select UnHide. You can do this with code in a manner similar to the following: ' hide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlHidden ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden ' unhide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlVisible ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible ' hide all but active sheet Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(ActiveSheet.Name, WS.Name, vbBinaryCompare) < 0 Then WS.Visible = xlSheetHidden End If Next WS ' unhide all sheets For Each WS In ThisWorkbook.Worksheets WS.Visible = xlSheetVisible Next WS When the Visible property is xlVisible, the sheet is visible. When the Visible property is xlHidden, the sheet is hidden but can be made visible from the Format menu. When the Visible property is xlVeryHidden, the sheet is hidden and cannot be made visible from the Format menu. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 29 Nov 2008 07:46:01 -0800, Abdul wrote: Can you make sheets invisible and if so, how can you recall them [make them visible again]? |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
Did you protect the workbook (not the worksheet)?
If so, then unprotect the workbook first. If no, you may want to share the code you're using to show the worksheets. John wrote: Hi Chip I installed the codes for Very Hidden and works fine but to unhide I get an error " Unable to set the visible property of the worksheet class" this error is in VB editor runing the macro with F5 in the worksheet I only get a Popup window with the number 400 nothing else Regards John There is no failure except in no longer trying. Elbert Hubbard "Chip Pearson" wrote in message ... To hide a sheet, go to the Format menu, choose Worksheet, and then select Hide. To make a hidden sheet visible, go to the Format menu, choose Worksheet, and then select UnHide. You can do this with code in a manner similar to the following: ' hide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlHidden ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden ' unhide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlVisible ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible ' hide all but active sheet Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(ActiveSheet.Name, WS.Name, vbBinaryCompare) < 0 Then WS.Visible = xlSheetHidden End If Next WS ' unhide all sheets For Each WS In ThisWorkbook.Worksheets WS.Visible = xlSheetVisible Next WS When the Visible property is xlVisible, the sheet is visible. When the Visible property is xlHidden, the sheet is hidden but can be made visible from the Format menu. When the Visible property is xlVeryHidden, the sheet is hidden and cannot be made visible from the Format menu. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 29 Nov 2008 07:46:01 -0800, Abdul wrote: Can you make sheets invisible and if so, how can you recall them [make them visible again]? -- Dave Peterson |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
Hi Dave
Thank you for your reply The workbook is not hiden and I used the same line as below to hide it ("Very hidden")The macro was places in sheet2 not workbook but also tried in the module, Here is the line code: Sub Visible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible End Sub Regards John "Dave Peterson" wrote in message ... Did you protect the workbook (not the worksheet)? If so, then unprotect the workbook first. If no, you may want to share the code you're using to show the worksheets. John wrote: Hi Chip I installed the codes for Very Hidden and works fine but to unhide I get an error " Unable to set the visible property of the worksheet class" this error is in VB editor runing the macro with F5 in the worksheet I only get a Popup window with the number 400 nothing else Regards John There is no failure except in no longer trying. Elbert Hubbard "Chip Pearson" wrote in message ... To hide a sheet, go to the Format menu, choose Worksheet, and then select Hide. To make a hidden sheet visible, go to the Format menu, choose Worksheet, and then select UnHide. You can do this with code in a manner similar to the following: ' hide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlHidden ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden ' unhide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlVisible ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible ' hide all but active sheet Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(ActiveSheet.Name, WS.Name, vbBinaryCompare) < 0 Then WS.Visible = xlSheetHidden End If Next WS ' unhide all sheets For Each WS In ThisWorkbook.Worksheets WS.Visible = xlSheetVisible Next WS When the Visible property is xlVisible, the sheet is visible. When the Visible property is xlHidden, the sheet is hidden but can be made visible from the Format menu. When the Visible property is xlVeryHidden, the sheet is hidden and cannot be made visible from the Format menu. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 29 Nov 2008 07:46:01 -0800, Abdul wrote: Can you make sheets invisible and if so, how can you recall them [make them visible again]? -- Dave Peterson |
#7
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
It's not the visibility of the workbook that's important. It's whether the
workbook is protected. In xl2003 menus: Tools|Protection Do you see "Unprotect Workbook" as an option? If you do, then you have to unprotect the workbook before you unhide a worksheet. This code belongs in a general module--not behind a worksheet and not behind the ThisWorkbook module. And by using ThisWorkbook, that means that the workbook containing the code is the workbook that should have Sheet3 made visible. ps. I wouldn't name the subroutine visible, I'd use a different name. Visible is the name of a property that VBA owns. It may not confuse excel, but it could confuse me. Sub MacVisible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible 'or maybe 'Activeworkbook.Worksheets("Sheet3").Visible = xlVisible End Sub John wrote: Hi Dave Thank you for your reply The workbook is not hiden and I used the same line as below to hide it ("Very hidden")The macro was places in sheet2 not workbook but also tried in the module, Here is the line code: Sub Visible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible End Sub Regards John "Dave Peterson" wrote in message ... Did you protect the workbook (not the worksheet)? If so, then unprotect the workbook first. If no, you may want to share the code you're using to show the worksheets. John wrote: Hi Chip I installed the codes for Very Hidden and works fine but to unhide I get an error " Unable to set the visible property of the worksheet class" this error is in VB editor runing the macro with F5 in the worksheet I only get a Popup window with the number 400 nothing else Regards John There is no failure except in no longer trying. Elbert Hubbard "Chip Pearson" wrote in message ... To hide a sheet, go to the Format menu, choose Worksheet, and then select Hide. To make a hidden sheet visible, go to the Format menu, choose Worksheet, and then select UnHide. You can do this with code in a manner similar to the following: ' hide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlHidden ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden ' unhide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlVisible ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible ' hide all but active sheet Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(ActiveSheet.Name, WS.Name, vbBinaryCompare) < 0 Then WS.Visible = xlSheetHidden End If Next WS ' unhide all sheets For Each WS In ThisWorkbook.Worksheets WS.Visible = xlSheetVisible Next WS When the Visible property is xlVisible, the sheet is visible. When the Visible property is xlHidden, the sheet is hidden but can be made visible from the Format menu. When the Visible property is xlVeryHidden, the sheet is hidden and cannot be made visible from the Format menu. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 29 Nov 2008 07:46:01 -0800, Abdul wrote: Can you make sheets invisible and if so, how can you recall them [make them visible again]? -- Dave Peterson -- Dave Peterson |
#8
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
Hi Dave
Thanks again for your patient. I deleted the problem file and started with a new one. I copied what you see below in a module. It will hide ok but will not unhide, still getting the same error. Regards John .................................................. ..... Sub testhide() ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden End Sub .................................................. ... Sub testunhide() 'ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible 'or maybe ActiveWorkbook.Worksheets("Sheet2").Visible = xlVisible End Sub .................................................. .... "Dave Peterson" wrote in message ... It's not the visibility of the workbook that's important. It's whether the workbook is protected. In xl2003 menus: Tools|Protection Do you see "Unprotect Workbook" as an option? If you do, then you have to unprotect the workbook before you unhide a worksheet. This code belongs in a general module--not behind a worksheet and not behind the ThisWorkbook module. And by using ThisWorkbook, that means that the workbook containing the code is the workbook that should have Sheet3 made visible. ps. I wouldn't name the subroutine visible, I'd use a different name. Visible is the name of a property that VBA owns. It may not confuse excel, but it could confuse me. Sub MacVisible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible 'or maybe 'Activeworkbook.Worksheets("Sheet3").Visible = xlVisible End Sub John wrote: Hi Dave Thank you for your reply The workbook is not hiden and I used the same line as below to hide it ("Very hidden")The macro was places in sheet2 not workbook but also tried in the module, Here is the line code: Sub Visible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible End Sub Regards John "Dave Peterson" wrote in message ... Did you protect the workbook (not the worksheet)? If so, then unprotect the workbook first. If no, you may want to share the code you're using to show the worksheets. John wrote: Hi Chip I installed the codes for Very Hidden and works fine but to unhide I get an error " Unable to set the visible property of the worksheet class" this error is in VB editor runing the macro with F5 in the worksheet I only get a Popup window with the number 400 nothing else Regards John There is no failure except in no longer trying. Elbert Hubbard "Chip Pearson" wrote in message ... To hide a sheet, go to the Format menu, choose Worksheet, and then select Hide. To make a hidden sheet visible, go to the Format menu, choose Worksheet, and then select UnHide. You can do this with code in a manner similar to the following: ' hide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlHidden ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden ' unhide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlVisible ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible ' hide all but active sheet Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(ActiveSheet.Name, WS.Name, vbBinaryCompare) < 0 Then WS.Visible = xlSheetHidden End If Next WS ' unhide all sheets For Each WS In ThisWorkbook.Worksheets WS.Visible = xlSheetVisible Next WS When the Visible property is xlVisible, the sheet is visible. When the Visible property is xlHidden, the sheet is hidden but can be made visible from the Format menu. When the Visible property is xlVeryHidden, the sheet is hidden and cannot be made visible from the Format menu. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 29 Nov 2008 07:46:01 -0800, Abdul wrote: Can you make sheets invisible and if so, how can you recall them [make them visible again]? -- Dave Peterson -- Dave Peterson |
#9
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
Me again
I should of said also that I tried both lines to unhide without success. john "John" wrote in message ... Hi Dave Thanks again for your patient. I deleted the problem file and started with a new one. I copied what you see below in a module. It will hide ok but will not unhide, still getting the same error. Regards John .................................................. .... Sub testhide() ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden End Sub .................................................. .. Sub testunhide() 'ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible 'or maybe ActiveWorkbook.Worksheets("Sheet2").Visible = xlVisible End Sub .................................................. ... "Dave Peterson" wrote in message ... It's not the visibility of the workbook that's important. It's whether the workbook is protected. In xl2003 menus: Tools|Protection Do you see "Unprotect Workbook" as an option? If you do, then you have to unprotect the workbook before you unhide a worksheet. This code belongs in a general module--not behind a worksheet and not behind the ThisWorkbook module. And by using ThisWorkbook, that means that the workbook containing the code is the workbook that should have Sheet3 made visible. ps. I wouldn't name the subroutine visible, I'd use a different name. Visible is the name of a property that VBA owns. It may not confuse excel, but it could confuse me. Sub MacVisible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible 'or maybe 'Activeworkbook.Worksheets("Sheet3").Visible = xlVisible End Sub John wrote: Hi Dave Thank you for your reply The workbook is not hiden and I used the same line as below to hide it ("Very hidden")The macro was places in sheet2 not workbook but also tried in the module, Here is the line code: Sub Visible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible End Sub Regards John "Dave Peterson" wrote in message ... Did you protect the workbook (not the worksheet)? If so, then unprotect the workbook first. If no, you may want to share the code you're using to show the worksheets. John wrote: Hi Chip I installed the codes for Very Hidden and works fine but to unhide I get an error " Unable to set the visible property of the worksheet class" this error is in VB editor runing the macro with F5 in the worksheet I only get a Popup window with the number 400 nothing else Regards John There is no failure except in no longer trying. Elbert Hubbard "Chip Pearson" wrote in message ... To hide a sheet, go to the Format menu, choose Worksheet, and then select Hide. To make a hidden sheet visible, go to the Format menu, choose Worksheet, and then select UnHide. You can do this with code in a manner similar to the following: ' hide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlHidden ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden ' unhide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlVisible ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible ' hide all but active sheet Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(ActiveSheet.Name, WS.Name, vbBinaryCompare) < 0 Then WS.Visible = xlSheetHidden End If Next WS ' unhide all sheets For Each WS In ThisWorkbook.Worksheets WS.Visible = xlSheetVisible Next WS When the Visible property is xlVisible, the sheet is visible. When the Visible property is xlHidden, the sheet is hidden but can be made visible from the Format menu. When the Visible property is xlVeryHidden, the sheet is hidden and cannot be made visible from the Format menu. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 29 Nov 2008 07:46:01 -0800, Abdul wrote: Can you make sheets invisible and if so, how can you recall them [make them visible again]? -- Dave Peterson -- Dave Peterson |
#10
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
Sorry, there was a typo in the original that I didn't notice.
Instead of using xlvisible, use: xlSheetVisible ActiveWorkbook.Worksheets("Sheet2").Visible = xlSheetVisible Remember, ActiveWorkbook refers to the workbook that's currently active. ThisWorkbook refers to the workbook that owns the code. They don't have to be the same workbook. John wrote: Me again I should of said also that I tried both lines to unhide without success. john "John" wrote in message ... Hi Dave Thanks again for your patient. I deleted the problem file and started with a new one. I copied what you see below in a module. It will hide ok but will not unhide, still getting the same error. Regards John .................................................. .... Sub testhide() ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden End Sub .................................................. .. Sub testunhide() 'ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible 'or maybe ActiveWorkbook.Worksheets("Sheet2").Visible = xlVisible End Sub .................................................. ... "Dave Peterson" wrote in message ... It's not the visibility of the workbook that's important. It's whether the workbook is protected. In xl2003 menus: Tools|Protection Do you see "Unprotect Workbook" as an option? If you do, then you have to unprotect the workbook before you unhide a worksheet. This code belongs in a general module--not behind a worksheet and not behind the ThisWorkbook module. And by using ThisWorkbook, that means that the workbook containing the code is the workbook that should have Sheet3 made visible. ps. I wouldn't name the subroutine visible, I'd use a different name. Visible is the name of a property that VBA owns. It may not confuse excel, but it could confuse me. Sub MacVisible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible 'or maybe 'Activeworkbook.Worksheets("Sheet3").Visible = xlVisible End Sub John wrote: Hi Dave Thank you for your reply The workbook is not hiden and I used the same line as below to hide it ("Very hidden")The macro was places in sheet2 not workbook but also tried in the module, Here is the line code: Sub Visible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible End Sub Regards John "Dave Peterson" wrote in message ... Did you protect the workbook (not the worksheet)? If so, then unprotect the workbook first. If no, you may want to share the code you're using to show the worksheets. John wrote: Hi Chip I installed the codes for Very Hidden and works fine but to unhide I get an error " Unable to set the visible property of the worksheet class" this error is in VB editor runing the macro with F5 in the worksheet I only get a Popup window with the number 400 nothing else Regards John There is no failure except in no longer trying. Elbert Hubbard "Chip Pearson" wrote in message ... To hide a sheet, go to the Format menu, choose Worksheet, and then select Hide. To make a hidden sheet visible, go to the Format menu, choose Worksheet, and then select UnHide. You can do this with code in a manner similar to the following: ' hide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlHidden ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden ' unhide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlVisible ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible ' hide all but active sheet Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(ActiveSheet.Name, WS.Name, vbBinaryCompare) < 0 Then WS.Visible = xlSheetHidden End If Next WS ' unhide all sheets For Each WS In ThisWorkbook.Worksheets WS.Visible = xlSheetVisible Next WS When the Visible property is xlVisible, the sheet is visible. When the Visible property is xlHidden, the sheet is hidden but can be made visible from the Format menu. When the Visible property is xlVeryHidden, the sheet is hidden and cannot be made visible from the Format menu. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 29 Nov 2008 07:46:01 -0800, Abdul wrote: Can you make sheets invisible and if so, how can you recall them [make them visible again]? -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#11
Posted to microsoft.public.excel.misc
|
|||
|
|||
Can you hide Sheets?
Thank you Dave
It works great. Regards John "Dave Peterson" wrote in message ... Sorry, there was a typo in the original that I didn't notice. Instead of using xlvisible, use: xlSheetVisible ActiveWorkbook.Worksheets("Sheet2").Visible = xlSheetVisible Remember, ActiveWorkbook refers to the workbook that's currently active. ThisWorkbook refers to the workbook that owns the code. They don't have to be the same workbook. John wrote: Me again I should of said also that I tried both lines to unhide without success. john "John" wrote in message ... Hi Dave Thanks again for your patient. I deleted the problem file and started with a new one. I copied what you see below in a module. It will hide ok but will not unhide, still getting the same error. Regards John .................................................. .... Sub testhide() ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden End Sub .................................................. .. Sub testunhide() 'ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible 'or maybe ActiveWorkbook.Worksheets("Sheet2").Visible = xlVisible End Sub .................................................. ... "Dave Peterson" wrote in message ... It's not the visibility of the workbook that's important. It's whether the workbook is protected. In xl2003 menus: Tools|Protection Do you see "Unprotect Workbook" as an option? If you do, then you have to unprotect the workbook before you unhide a worksheet. This code belongs in a general module--not behind a worksheet and not behind the ThisWorkbook module. And by using ThisWorkbook, that means that the workbook containing the code is the workbook that should have Sheet3 made visible. ps. I wouldn't name the subroutine visible, I'd use a different name. Visible is the name of a property that VBA owns. It may not confuse excel, but it could confuse me. Sub MacVisible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible 'or maybe 'Activeworkbook.Worksheets("Sheet3").Visible = xlVisible End Sub John wrote: Hi Dave Thank you for your reply The workbook is not hiden and I used the same line as below to hide it ("Very hidden")The macro was places in sheet2 not workbook but also tried in the module, Here is the line code: Sub Visible() ThisWorkbook.Worksheets("Sheet3").Visible = xlVisible End Sub Regards John "Dave Peterson" wrote in message ... Did you protect the workbook (not the worksheet)? If so, then unprotect the workbook first. If no, you may want to share the code you're using to show the worksheets. John wrote: Hi Chip I installed the codes for Very Hidden and works fine but to unhide I get an error " Unable to set the visible property of the worksheet class" this error is in VB editor runing the macro with F5 in the worksheet I only get a Popup window with the number 400 nothing else Regards John There is no failure except in no longer trying. Elbert Hubbard "Chip Pearson" wrote in message ... To hide a sheet, go to the Format menu, choose Worksheet, and then select Hide. To make a hidden sheet visible, go to the Format menu, choose Worksheet, and then select UnHide. You can do this with code in a manner similar to the following: ' hide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlHidden ThisWorkbook.Worksheets("Sheet2").Visible = xlVeryHidden ' unhide the sheets ThisWorkbook.Worksheets("Sheet1").Visible = xlVisible ThisWorkbook.Worksheets("Sheet2").Visible = xlVisible ' hide all but active sheet Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets If StrComp(ActiveSheet.Name, WS.Name, vbBinaryCompare) < 0 Then WS.Visible = xlSheetHidden End If Next WS ' unhide all sheets For Each WS In ThisWorkbook.Worksheets WS.Visible = xlSheetVisible Next WS When the Visible property is xlVisible, the sheet is visible. When the Visible property is xlHidden, the sheet is hidden but can be made visible from the Format menu. When the Visible property is xlVeryHidden, the sheet is hidden and cannot be made visible from the Format menu. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 29 Nov 2008 07:46:01 -0800, Abdul wrote: Can you make sheets invisible and if so, how can you recall them [make them visible again]? -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to hide sheets | Excel Worksheet Functions | |||
Hide sheets | Excel Worksheet Functions | |||
Hide sheets based on Cell value | Excel Discussion (Misc queries) | |||
hide sheets use data | Excel Worksheet Functions | |||
macro to hide sheets | Excel Discussion (Misc queries) |