Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Hide/Unhide sheets

Is it possible to hide and unhide sheets thru VBA?

Thnks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Hide/Unhide sheets

Hi Dave

Try
Sheets("Sheet1").Visible = False
..
..
..
Sheets("Sheet1").Visible = True

--
Regards
Roger Govier
" wrote in
message ...
Is it possible to hide and unhide sheets thru VBA?

Thnks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Hide/Unhide sheets

Thnks

"Roger Govier" wrote in message
...
Hi Dave

Try
Sheets("Sheet1").Visible = False
.
.
.
Sheets("Sheet1").Visible = True

--
Regards
Roger Govier
" wrote in
message ...
Is it possible to hide and unhide sheets thru VBA?

Thnks






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hide/Unhide sheets

Public Sub Hidesheets()
Dim sh as Worksheet
for each sh in thisworkbook.worksheets
if sh.Name < "Sheet1" then
sh.visible = xlSheetHidden
else
sh.Visible = xlSheetVisible
end if
Next
End Sub


as an example.
--
Regards,
Tom Ogilvy

wrote in message
...
Is it possible to hide and unhide sheets thru VBA?

Thnks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Hide/Unhide sheets

Just to add, the acceptable constants a

? xlSheetVisible
-1
? xlSheetHidden
0
? xlSheetVeryHidden
2

True is coerced to -1
False is coerced to 0

so they work as well.

--
Regards,
Tom Ogilvy


Roger Govier wrote in message
...
Hi Dave

Try
Sheets("Sheet1").Visible = False
.
.
.
Sheets("Sheet1").Visible = True

--
Regards
Roger Govier
" wrote in
message ...
Is it possible to hide and unhide sheets thru VBA?

Thnks






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
Toolbar buttons to hide/unhide sheets Barb in MD Excel Discussion (Misc queries) 4 February 10th 10 01:46 AM
Macro-Hide & Unhide Sheets with condition [email protected] Excel Discussion (Misc queries) 8 August 22nd 07 02:04 AM
Hide or unhide sheets based on cell billinr Excel Discussion (Misc queries) 2 July 13th 07 07:42 PM
Password to hide and unhide sheets Veera Excel Programming 2 July 23rd 03 04:23 PM
Password to hide and unhide sheets Patrick Molloy Excel Programming 0 July 23rd 03 04:04 PM


All times are GMT +1. The time now is 08:57 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"