|
发表于 2013-12-28 16:26
|
显示全部楼层
本楼为最佳答案
本帖最后由 hwc2ycy 于 2013-12-28 16:29 编辑
- Private Sub Workbook_Open()
- On Error Resume Next
- Static i As Byte
- Dim myrow As Integer
- Application.Visible = False
- star:
- If i = 3 Then
- KILLME
- End If
- XX = Application.InputBox("输入密码", "提示", Type:=1)
- myrow = WorksheetFunction.Match(XX, Sheets("数据").Range("a:a"), 0)
- if xx=false then goto star
- If myrow > 0 Then
- ThisWorkbook.Sheets("查询").Visible = True
- Application.Visible = True
- Sheets("数据").Cells(myrow, 1).Resize(1, 6).Copy Sheets("查询").Cells(13, 3)
- Else
- i = i + 1
- If i < 3 Then MsgBox "卡号错误,请重新输入,还有" & 3 - i & "次机会"
- GoTo star:
- End If
- Sheets(1).Select
- End Sub
复制代码 我这没有看到你说的输入一次错误就退出的现象啊。
|
|