Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Far Far is offline
external usenet poster
 
Posts: 4
Default For Next & Hidden Sheets Issue

The following procedure creates an error if there is
hidden sheets in workbook. How can I have this procedure
ignore the hidden sheets? ... Thanks

Sub Set_Page_Preview_Normal()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Select
ActiveWindow.View = xlNormalView
Next wks
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default For Next & Hidden Sheets Issue

Hi Far,

Far schrieb:
The following procedure creates an error if there is
hidden sheets in workbook. How can I have this procedure
ignore the hidden sheets? ... Thanks


try this:
For Each wks In ActiveWorkbook.Worksheets
If wks.Visible = xlSheetVisible Then
wks.Select
ActiveWindow.View = xlNormalView
End If
Next wks

--
Regards

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default For Next & Hidden Sheets Issue

Sub Set_Page_Preview_Normal()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
If wks.Visible < xlSheetVisible Then
wks.Select
ActiveWindow.View = xlNormalView
End If
Next wks
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Far" wrote in message
...
The following procedure creates an error if there is
hidden sheets in workbook. How can I have this procedure
ignore the hidden sheets? ... Thanks

Sub Set_Page_Preview_Normal()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Select
ActiveWindow.View = xlNormalView
Next wks
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default For Next & Hidden Sheets Issue

oops, change the < to =

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Bob Phillips" wrote in message
...
Sub Set_Page_Preview_Normal()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
If wks.Visible < xlSheetVisible Then
wks.Select
ActiveWindow.View = xlNormalView
End If
Next wks
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Far" wrote in message
...
The following procedure creates an error if there is
hidden sheets in workbook. How can I have this procedure
ignore the hidden sheets? ... Thanks

Sub Set_Page_Preview_Normal()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Select
ActiveWindow.View = xlNormalView
Next wks
End Sub





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
hidden sheets Soccerboy83 Excel Discussion (Misc queries) 5 November 25th 09 06:17 PM
2003/2007 Compatibility Issue - Hidden Sheets NickH Excel Discussion (Misc queries) 4 August 28th 09 10:53 AM
Chart Issue With Hidden Cells GMc[_2_] Excel Worksheet Functions 2 June 10th 08 06:53 PM
Hidden Sheets QUESTION-MARK Excel Worksheet Functions 4 May 19th 06 07:06 PM
Help! Calling hidden sheets? Ron de Bruin Excel Programming 0 February 5th 04 07:02 PM


All times are GMT +1. The time now is 04:23 AM.

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

About Us

"It's about Microsoft Excel"