Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Using OfficeXP.
In a fresh workbook from the immediate window... This works. Worksheets(Array("Sheet1", "Sheet2")).Visible = xlSheetHidden This: Worksheets(Array("Sheet1", "Sheet2")).Visible = xlSheetVisible gives the following error Run-time error '1004': Unable to set the Visible property of the Sheets class This seems like an easy one, but I haven't been able to find an answer. Thanks, -Jeremy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can use this Jeremy
Dim sh As Worksheet For Each sh In Sheets(Array("Sheet1", "Sheet2")) sh.Visible = True Next -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Jeremy Gollehon" wrote in message ... Using OfficeXP. In a fresh workbook from the immediate window... This works. Worksheets(Array("Sheet1", "Sheet2")).Visible = xlSheetHidden This: Worksheets(Array("Sheet1", "Sheet2")).Visible = xlSheetVisible gives the following error Run-time error '1004': Unable to set the Visible property of the Sheets class This seems like an easy one, but I haven't been able to find an answer. Thanks, -Jeremy |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the reply Ron.
So that means there's no way to do it without a loop? My actual array is much larger. I wonder why the hide works, but the unhide doesn't? -Jeremy Ron de Bruin wrote: You can use this Jeremy Dim sh As Worksheet For Each sh In Sheets(Array("Sheet1", "Sheet2")) sh.Visible = True Next "Jeremy Gollehon" wrote in message ... Using OfficeXP. In a fresh workbook from the immediate window... This works. Worksheets(Array("Sheet1", "Sheet2")).Visible = xlSheetHidden This: Worksheets(Array("Sheet1", "Sheet2")).Visible = xlSheetVisible gives the following error Run-time error '1004': Unable to set the Visible property of the Sheets class This seems like an easy one, but I haven't been able to find an answer. Thanks, -Jeremy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hide/Unhide worksheets upon entries in a range of the main worksheet | Excel Discussion (Misc queries) | |||
Hide/Unhide row VBA | Excel Discussion (Misc queries) | |||
How do I hide and unhide worksheets in Excel 2007? | Excel Discussion (Misc queries) | |||
Hide Unhide | Excel Discussion (Misc queries) | |||
Hide/unhide | Excel Worksheet Functions |