找人帮忙给一段VBA代码分下行

来源:百度知道 编辑:UC知道 时间:2024/05/23 19:17:59
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set ect = Application.Intersect(Target, Range("a1:e5")) ' If Not ect Is Nothing Then If ect.Cells.Count > 1 Then [f6].Select Exit Sub End If Set Tar = ect.Cells(1) If Tar <> "" Then ' psw = InputBox("请输入修改密码:(密码为1234)", "密码确认") If psw <> "1234" Then MsgBox "非法用户!你没有修改此单元格权限! ", vbInformation, "警告!" [f6].Select ' End If End If End If End Sub

这一段是我找到的代码,本人不会VBA语言。请高人帮忙分下行

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set ect = Application.Intersect(Target, Range("a1:e5")) '
If Not ect Is Nothing Then
If ect.Cells.Count > 1 Then
[f6].Select
Exit Sub
End If
Set Tar = ect.Cells(1)
If Tar <> "" Then '
psw = InputBox("请输入修改密码:(密码为1234)", "密码确认")
If psw <> "1234" Then MsgBox "非法用户!你没有修改此单元格权限! ", vbInformation, "警告!"
[f6].Select '
End If
End If
End If
End Sub