vba 防止在excel中调整单元格大小
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8851700/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Prevent cell resize in excel
提问by Romi24
This may seem to be a very simple question for a number of Excel users out there. Yes, I admit I am ignorant about this.
对于许多 Excel 用户来说,这似乎是一个非常简单的问题。是的,我承认我对此一无所知。
The question is quite simple.
问题很简单。
How do I prevent manual re-sizing of a cell in Excel? In other words the user should not be able to change either the width or height of a cell / range of cells
如何防止在 Excel 中手动调整单元格大小?换句话说,用户不应更改单元格/单元格范围的宽度或高度
Is this done through writing VBA code? Or can it be carried out in any other way using standard Excel menu based commands?
这是通过编写 VBA 代码完成的吗?或者可以使用基于标准 Excel 菜单的命令以任何其他方式执行吗?
Thanks in advance
提前致谢
Romi
罗米
采纳答案by Robert Mearns
You will need to 'Protect' the sheet
您将需要“保护”工作表
There are two steps:
有两个步骤:
- Make sure the cells are locked
- Protect the sheet
- 确保单元格已锁定
- 保护工作表
In Excel 2010
在 Excel 2010 中
- Select the cells you want to prevent from being resized.
- Click on the Home tab and click to expand the Font section
- Select the Protection tab and make sure that the Locked box is ticked
- Click on the Review tab and then Protect sheet
- Click on the OK button
- 选择要防止调整大小的单元格。
- 单击“主页”选项卡,然后单击以展开“字体”部分
- 选择保护选项卡并确保选中锁定框
- 单击“审阅”选项卡,然后单击“保护工作表”
- 单击确定按钮
回答by Siddharth Rout
You can lock the spreadsheet. That would prevent the user from resizing the Columns or the Rows.
您可以锁定电子表格。这将阻止用户调整列或行的大小。