Excel/VBA or Macro to Hide Excel Sheet
I am looking to hide two sheets in my excel file upon close and make them visible when the file is opened. Another layer to this scenario is to only hide the two tabs if a cell within one of the sheets is less than zero.
So for my example I have a “Disposal Summary” sheet and a “Disposal Detail” sheet. If cell E37 in the “Disposal Summary” sheet is less than zero, hide both sheets on close of the file and make visible when file is opened. If cell E37 in the “Disposal Summary” is greater than zero leave both sheets visible on close.
Can this be done using a macro or VBA coding? I am using Excel 2010.
Thank you in advance for the help.
I'm not clear about the first part of your question - if you want to hide a sheet when the file is closed and you want to I hide it when the file is opened. What is the point of it? Anyways once you open the file, the sheet is visible. Why hide it while closing the file?
The second part is easy to handle by adding a check on file close event, depending on your answer to my question above, I can create a quick macro and send it across.
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here