代码如下:
Private Sub July241()
Sheets("sheet1").Cells.Font.ColorIndex = 2 '防止文档越权使用者看到内容
If Application.InputBox("请输入操作权限密码:") = 123 Then
Sheets("sheet1").Cells.Font.ColorIndex = 56 '输入正确的密码之后文字将会变为深灰色
Else MsgBox "密码错误,即将退出!"
Sheets("工作表1").Select
End If
End Sub