ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to hide a sheet (https://www.excelbanter.com/excel-programming/335763-macro-hide-sheet.html)

Kent McPherson[_3_]

Macro to hide a sheet
 
Is there an ActiveWorkbook... macro command to hide the current worksheet?

Tushar Mehta

Macro to hide a sheet
 
In article ,
says...
Is there an ActiveWorkbook... macro command to hide the current worksheet?

Turn on the macro recorder (Tools | Macro Record new macro...) hide
the current worksheet and turn off the recorder. Switch to the VBE.
XL should have generated the necessary code for you.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

Kent McPherson[_3_]

Macro to hide a sheet
 
Tushar Mehta wrote:
In article ,
says...

Is there an ActiveWorkbook... macro command to hide the current worksheet?


Turn on the macro recorder (Tools | Macro Record new macro...) hide
the current worksheet and turn off the recorder. Switch to the VBE.
XL should have generated the necessary code for you.

Thanks. I have the code to hide the current worksheet. I'm now looking
for code to hide a specific named worksheet.

dominicb[_70_]

Macro to hide a sheet
 

Good afternoon Kent McPherson

Yes. Try this:

ActiveSheet.Visible = False

Just remember not to try this on a workbook with only one sheet, as a
error will be returned. At leastOne worksheet must always be visible.

HTH

Dominic

--
dominic
-----------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893
View this thread: http://www.excelforum.com/showthread.php?threadid=39092



All times are GMT +1. The time now is 07:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com