Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook which contains 40+ sheets that is filled out by our vendors
and returned to us. Not all sheets are used every time and I would like to hide the unused sheets before submitting to document control. Every sheet has information on it as there are cell references on each sheet to basic job information filled out on sheet one. I was thinking about a macro or VBA that runs behind a hidden command button that would determine if certain fields on each sheet were filled or empty, and hide the sheets that had the empty fields. All of the sheets are protected, so obviously the code would have to unprotect the sheets before hiding. I know what end result I would like, but€¦ I have no idea where to start! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
We can start from he-
Sub sonic() 'Scroll through worksheets Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets ws.Select If Range("A1").Value = "" Then ws.Visible = False Next ws End Sub This will loop through all worksheets and hide them if A1 is empty. Two points. It will fail if A1 is empty in all sheets because you can't hide all sheets and 2 you don't have to unprotect a protected sheet to hide it. Mike "suznal" wrote: I have a workbook which contains 40+ sheets that is filled out by our vendors and returned to us. Not all sheets are used every time and I would like to hide the unused sheets before submitting to document control. Every sheet has information on it as there are cell references on each sheet to basic job information filled out on sheet one. I was thinking about a macro or VBA that runs behind a hidden command button that would determine if certain fields on each sheet were filled or empty, and hide the sheets that had the empty fields. All of the sheets are protected, so obviously the code would have to unprotect the sheets before hiding. I know what end result I would like, but€¦ I have no idea where to start! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Put data into individual worksheets | New Users to Excel | |||
Master Worksheets and Individual Worksheets | Excel Worksheet Functions | |||
hiding individual characters in Excel | Excel Discussion (Misc queries) | |||
hiding individual cell values when printing | Excel Discussion (Misc queries) | |||
Answer to Saving worksheets as individual workbooks using code? | Excel Programming |