- 帖子
- 2848
- 主題
- 10
- 精華
- 0
- 積分
- 2903
- 點名
- 0
- 作業系統
- 〔略〕
- 軟體版本
- 〔略〕
- 閱讀權限
- 100
- 性別
- 男
- 來自
- 〔略〕
- 註冊時間
- 2013-5-13
- 最後登錄
- 2026-7-25
|
Private Sub CommandButton1_Click()
Dim PassWD, xE1 As Range, xE2 As Range, T$
If TextBox1 = "" Then MsgBox "請輸入ID": Exit Sub
If TextBox2 = "" Then MsgBox "請輸入密碼": Exit Sub
Set xE1 = [交接事項!A65536].End(xlUp)(2)
Set xE2 = [交接事項!I65536].End(xlUp)(2)
PassWD = Application.VLookup(TextBox1, [Sheet3!E:F], 2, 0)
If IsError(PassWD) Then T = "ID錯誤"
If T = "" Then If PassWD & "" <> TextBox2.Text Then T = "密碼錯誤"
If T <> "" Then
xE2.Resize(1, 4) = Array(Date, Time, TextBox1, T): MsgBox T: GoTo 999
End If
xE1.Resize(1, 3) = Array(Date, Time, TextBox1): MsgBox "登入成功"
999:
If xE1.Row > 4500 Or xE2.Row > 4500 Then MsgBox "記錄量過大,請清理舊記錄!"
End Sub
====================================
TextBox2 的〔屬性.PasswordChar〕設為 "*",字設〔黑色〕,
輸入密碼時,自動顯示為〔****〕 |
|