|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 ami198505 于 2014-12-3 10:43 编辑
下面这个是只能第一列点一下才有时间显示:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column <> 1 Or Target <> "" Then Exit Sub
If ActiveSheet.ProtectContents Then
If InputBox("请输入密码:") = "123" Then
ActiveSheet.Unprotect "123"
Target = Now
Target.Locked = True
ActiveSheet.Protect Password:="123", DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFiltering:=True
End If
Else
Target = Now
Target.Locked = True
ActiveSheet.Protect Password:="123", DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFiltering:=True
End If
End Sub
怎么修改才能后面每个名字对应的都能显示时间呢?
|
|