LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Test for value and hide or unhide based on result

Hi...

How would I test a cell in each worksheet of my workbook for a value,
then hide that worksheet based on the result?

Also, is there an "unhide all" function that can be implemented at the
front end of such a macro routine?

I have this for testing the value of each sheet's specific cell location
as it steps through the sheets, butI would rather have it step through
the whole sheet, hiding certain sheets, then performing a single workbook
print job at the end.

Is there a hide and an unhide function call? I want to insert that
into the IF statement and move the print statement to the end and make it
print the entire workbook minus the hidden sheets.

quoted macro:

Sub selprint()
Dim i As Integer
Dim currentsheet As Worksheet

For i = 1 To ActiveWorkbook.Worksheets.Count
Set currentsheet = ActiveWorkbook.Worksheets(i)
Worksheets(i).Activate
'Skip empty sheets and hidden sheets
If Application.CountA(currentsheet.Cells) < 0 And currentsheet.Visible
(place this then call at end of above line) Then
'change the hard-coded cell here if not F52
If (Not IsNull(Range("F52"))) And (Range("F52").Value < 0) Then
'un-comment the next line when debugging completed
ActiveSheet.PrintOut
'add comment at start of next line when debugging completed
' ActiveSheet.PrintPreview
End If
End If
Next i
End Sub
 
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
Macro to hide/unhide WS based upon WS tab color Joe M. Excel Discussion (Misc queries) 1 April 8th 10 07:28 PM
Hide or unhide sheets based on cell billinr Excel Discussion (Misc queries) 2 July 13th 07 07:42 PM
Macro to hide and unhide based on criteria [email protected] Excel Discussion (Misc queries) 1 June 5th 06 08:05 PM
Hide or Unhide Column Based on Cell Value windsurferLA Excel Programming 2 March 31st 06 11:06 PM
Hide/Unhide worksheets based on login? jej1216 Excel Programming 2 February 28th 06 03:17 AM


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