给工作表加密VBA
Private Sub Worksheet_Activate() '激活工作表触发的程序a = InputBox("请输入密码")
If a = 123 Then
Cells.Font.Color = RGB(0, 0, 0)
Application.EnableEvents = False
Else
Sheet3.Activate
End If
End Sub
工作薄:
'Private Sub Workbook_Open()
'Application.EnableEvents = True
'Sheet2.Cells.Font.Color = RGB(255, 255, 255)
'Sheet3.Activate
'End Sub
页:
[1]