nnsea 发表于 2020-2-22 16:00:40

给工作表加密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


nnsea 发表于 2020-2-22 16:03:44

工作薄:
'Private Sub Workbook_Open()
'Application.EnableEvents = True
'Sheet2.Cells.Font.Color = RGB(255, 255, 255)
'Sheet3.Activate
'End Sub

页: [1]
查看完整版本: 给工作表加密VBA