值班登记表
我做的一个值班表,是用下面的代码做的选择,生动替换成符号:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row <= 34 And Target.Row >= 4 And Target.Column <= 7 And Target.Column >= 2 Then
If Target.Count = 1 Then
If Target.Value <> "" Then
ActiveSheet.Unprotect
Target.Locked = True
ActiveSheet.Protect
End If
End If
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
考勤 Target
End Sub
Sub 考勤(Rag As Range)
On Error Resume Next
If CStr(Rag.Value) = "" Then Exit Sub
Select Case CStr(Rag.Value)
Case "空白"
Rag.Value = ""
Case "李四"
Rag.Value = "△"
Case "张三"
Rag.Value = "○"
Case "王五"
Rag.Value = "☆"
Case "赵六"
Rag.Value = "◇"
Case "钱七"
Rag.Value = "□"
Case "猪八"
Rag.Value = "◎"
End Select
End Sub
申明:内容来自用户上传,著作权归原作者所有,如涉及侵权问题,请点击此处联系,我们将及时处理!
全部回复(2 )
只看楼主 我来说两句抢地板回复 举报
回复 举报