Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Hide range of worksheets in a workbook

Good afternoon;

I have two macros that I created some time ago that Hides and Unhides
specific sheets in a workbook.

I want to be able to hid and unhide all the sheets in a workbook, regardless
of what they are named.

The line I am having trouble with is:

Sheets("Sheet1").Visible = xlVeryHidden

What can I replace "Sheet1" with to make all the sheets, regardless of their
name very hidden?

Thanks and regards
Phil


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Hide range of worksheets in a workbook

Try this but note that there must be one visible worksheet; change "Sheet1"
to suit.

For Each ws In Worksheets
If ws.Name < "Sheet1" Then
ws.Visible = False ( or xlVeryHidden)
End If
Next

HTH

"AuthorizedUserPF" wrote:

Good afternoon;

I have two macros that I created some time ago that Hides and Unhides
specific sheets in a workbook.

I want to be able to hid and unhide all the sheets in a workbook, regardless
of what they are named.

The line I am having trouble with is:

Sheets("Sheet1").Visible = xlVeryHidden

What can I replace "Sheet1" with to make all the sheets, regardless of their
name very hidden?

Thanks and regards
Phil



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Hide range of worksheets in a workbook

I think that should be

For Each ws In Activeworkbook.Worksheets
If ws.Name < "Sheet1" Then
ws.Visible = xlVeryHidden
End If
Next


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Toppers" wrote in message
...
Try this but note that there must be one visible worksheet; change

"Sheet1"
to suit.

For Each ws In Worksheets
If ws.Name < "Sheet1" Then
ws.Visible = False ( or xlVeryHidden)
End If
Next

HTH

"AuthorizedUserPF" wrote:

Good afternoon;

I have two macros that I created some time ago that Hides and Unhides
specific sheets in a workbook.

I want to be able to hid and unhide all the sheets in a workbook,

regardless
of what they are named.

The line I am having trouble with is:

Sheets("Sheet1").Visible = xlVeryHidden

What can I replace "Sheet1" with to make all the sheets, regardless of

their
name very hidden?

Thanks and regards
Phil





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide/Unhide worksheets upon entries in a range of the main worksheet ran58 Excel Discussion (Misc queries) 5 July 22nd 09 07:31 AM
using the same range name on different worksheets in a workbook Paul Excel Discussion (Misc queries) 9 May 28th 09 02:07 AM
Protect or Hide all worksheets in a workbook except 1 Gator Girl Excel Worksheet Functions 2 February 4th 09 02:14 AM
How can I hide multiple worksheets that are in a workbook? Ron[_2_] Excel Discussion (Misc queries) 3 January 16th 08 11:09 PM
Is there a way to hide worksheets and/or rows/columns based on information enter into a particular cell of range of cells? Marc New Users to Excel 1 March 10th 06 05:10 PM


All times are GMT +1. The time now is 07:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"