View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Hiding and Unhiding Worksheets

Maybe I can be more explicit. I want to unhide the Vendor Worksheet only
(In this case it could be a Merchant Worksheet, Or a Procurement Worksheet)
I don't want to specify names of other worksheets that need to be hidden for
some may not be created as yet. I want to specify one sheet to be visible in
separate macros. So one macro would say unhide the Vendor Worksheet and hide
the rest. Another might say unhide the Merchant Worksheet and the Vendor
Worksheet and hide the rest.


"Tom Ogilvy" wrote:

You can't hide all, since at least one worksheet needs to be visible all the
time.

Dim sh as worksheet
list = Array(1,5,8,9,10)
for i =lbound(list) to ubound(list)
set sh = Nothing
On Error Resume Next
set sh = worksheets(list(i))
On Error goto 0
if not sh is nothing then
sh.Visible = xlSheetVisible
Next

--
REgards,
Tom Ogilvy

"Rob" wrote in message
...
How do I hide any worksheets that are hidden. In some of my macros, I am
creating worksheets in a workbook but at certain instances all of these
worksheets may not be created and others may. I want to just specify

unhide
all or hide all.