使用VBA隐藏Excel工作表 [英] Hiding an Excel worksheet with VBA

查看:199
本文介绍了使用VBA隐藏Excel工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张有三张表的Excel电子表格。其中一张表格包含其他表单的公式。



是否有一种方式将其以pprogrammatically方式隐藏,其中包含这些公式?

解决方案

要从UI中隐藏,请使用格式>工作表>隐藏



,请使用 Worksheet 对象的 Visible 属性。如果您以编程方式执行,您可以将该表格设置为非常隐藏,这意味着它不能通过UI取消隐藏。

  ActiveWorkbook.Sheets(Name)。Visible = xlSheetVeryHidden 
'或xlSheetHidden或xlSheetVisible

您还可以通过VBA IDE中的工作表的属性窗格( ALT + F11 )设置Visible属性。


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

Is there is a way of hiding it that sheet pprogrammatically, which contains these formulas?

解决方案

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).

这篇关于使用VBA隐藏Excel工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆