工具/原料
excel2010
方法/步骤
1.我们打开一个准备操作的表格
2.首先我们将鼠标移动到,如图位置将工作表选中

3.单击鼠标右键,选择设置单元格格式

4.在弹出的新对话框中选择保护选项

5.我们将锁定前边的勾选去掉,并点击确定按钮

6.按ALT+F11组合键进入VBA编辑模式

7. 在左侧的工程窗口选择要保护的工作表在右面的代码窗口输入以下代码:Private Sub Worksheet_SelectionChange(ByVal Target As Range)关闭VBE窗口 On Error Resume Next

8.我们回到工作表输入数字试试看能不能修改,我们发现在输入有数据的单元格只要我们选中就会弹出,需要输入密码才行
