Hiding an Excel worksheet with VBA

后端 未结 5 994
再見小時候
再見小時候 2020-12-05 17:33

I have an Excel spreadsheet with three sheets. One of the sheets contains formulas for one of the other sheets.

Is there a programmatic way to hide the sheet which c

5条回答
  •  春和景丽
    2020-12-05 18:09

    To hide from the UI, use Format > Sheet > Hide

    To hide programatically, use the Visible property of the Worksheet object. If you do it programatically, you can set the sheet as "very hidden", which means it cannot be unhidden through the UI.

    ActiveWorkbook.Sheets("Name").Visible = xlSheetVeryHidden 
    ' or xlSheetHidden or xlSheetVisible
    

    You can also set the Visible property through the properties pane for the worksheet in the VBA IDE (ALT+F11).

提交回复
热议问题