Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Loop to hide sheet based on cell

Hi,

I am trying to create a simple loop to hide worksheets in my workbook
based on value reported on a specific cell on each worksheet.
If value on cell B8 on the worksheet is equal to "No Data", hide this
worksheet. If not, keep visible. Then go to the next worksheet.

Thanks for your help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Loop to hide sheet based on cell

hi,

On Error Resume Next
For Each oSheet In Worksheets
If oSheet.Range("B8") = "No Data" Then
oSheet.Visible = False
If Err.Number < 0 Then Err.Clear: Exit Sub
Else
oSheet.Visible = True
End If
Next



--
isabelle



Le 2011-10-06 10:35, Norvascom a écrit :
Hi,

I am trying to create a simple loop to hide worksheets in my workbook
based on value reported on a specific cell on each worksheet.
If value on cell B8 on the worksheet is equal to "No Data", hide this
worksheet. If not, keep visible. Then go to the next worksheet.

Thanks for your help

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 rows of one sheet based on values in another sheet? Andrew Raastad Excel Programming 2 June 23rd 09 11:11 PM
Hide a sheet based on a cell condition noord453 Excel Programming 4 April 16th 09 12:05 PM
CF based on data analysis, Loop thru sheet hspence Excel Programming 1 March 22nd 07 04:32 PM
Hide a sheet based on value! Gordon[_2_] Excel Programming 4 October 4th 06 11:56 PM
Hide/unhide sheet macro based on cell calculation Greg Fisher Excel Programming 3 May 26th 05 05:58 PM


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