Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to hide/unhide WS based upon WS tab color | Excel Discussion (Misc queries) | |||
Hide or unhide sheets based on cell | Excel Discussion (Misc queries) | |||
Macro to hide and unhide based on criteria | Excel Discussion (Misc queries) | |||
Hide or Unhide Column Based on Cell Value | Excel Programming | |||
Hide/Unhide worksheets based on login? | Excel Programming |