|
用户的正确密码是:123456
确认按钮的代码为:
Private Sub pw1_Click()
If Worksheets(1).Range("C4").Value = Sheets(3).Range("E1") Then
Worksheets(2).Activate
ActiveSheet.Protect DrawingObjects:=flase, Contents:=flase, Scenarios:=flase
Worksheets(1).Activate
Range("B4:D4").Select
Selection.Copy
Sheets("Sheet3").Activate
Dim counter As Integer
counter = 2
Do Until Sheets("sheet3").Cells(counter, 3).Value = Sheets(3).Cells(1, 6)
counter = counter + 1
Loop
Sheets("Sheet3").Cells(counter, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Sheet2").Activate
Else: MsgBox "密码错误"
End If
End Sub |
|