- ©«¤l
- 28
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 78
- ÂI¦W
- 0
- §@·~¨t²Î
- windows xp
- ³nÅ骩¥»
- excel 2003
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2013-12-4
- ³Ì«áµn¿ý
- 2023-3-29
|
³Â·Ð¦U¦ì°ª¤âÀ°¦£¤F,¬õ¦â³¡¥÷¬O¤p§Ì·Qn¼W¥[§PÂ_¼g¤JÀx¦s®æªº¦a¤è
Private Sub CommandButton1_Click()
Sheet2.Visible = True
Sheets("¥æ±µ¨Æ¶µ").Activate
Dim UserId As String
Dim N As Long
Dim FD As Range
Set FD = Range("a65536").End(xlUp).Offset(1, 0)
Dim Ar, a1, i% '¦¹³B«Å§i3ÓÄæ¦ì
a1 = TextBox1
Ar = Array(a1) 'Äæ¦ìÀx¦s©ó°}¦C
UserId = TextBox1.Value
If UserId = "" Then
MsgBox "½Ð¿é¤JID"
GoTo 101
End If
For N = 1 To 300
If Sheet3.Cells(N, 5).Value = UserId Then
If Sheet3.Cells(N, 6).Value = TextBox2.Value Then
MsgBox "µn¤J¦¨¥\"
if a1 <> "" Then '§PÂ_©Ò¦³È³£¤£µ¥©óªÅ¥Õ
i = 2 '²Ä¤@¦C¶}©l
Do Until Cells(i, 1) = "" 'AÄ欰ªÅ¥Õ«h°±¤î°j°é
i = i + 1 '¦V¤U¤@¦C
Loop
Cells(i, 3).Resize(, 1) = Ar 'AÄæªÅ¥Õ¦V¥kÂX®i¦¨Äæ¦ì¼Æ¶q
FD = Date '©¹¥k¤@®æ¼g¤J·í«e®É¶¡
FD.Offset(0, 1) = Time '©¹¥k¤G®æ¼g¤JtxtIDªº¸ê®Æ
End If
UserForm1.Hide
GoTo 101
Else
MsgBox "µn¤J¥¢±Ñ"
i = 2 '²Ä¤@¦C¶}©l
Do Until Cells(i, 1) = "" 'AÄ欰ªÅ¥Õ«h°±¤î°j°é
i = i + 1 '¦V¤U¤@¦C
Loop
Cells(i, 10).Resize(, 1) = Ar 'AÄæªÅ¥Õ¦V¥kÂX®i¦¨Äæ¦ì¼Æ¶q
FD.Offset(0, 8) = Date '©¹¥k¤@®æ¼g¤J·í«e®É¶¡
FD.Offset(0, 9) = Time '©¹¥k¤G®æ¼g¤JtxtIDªº¸ê®Æ
End If
GoTo 101
Exit For
End If
end if
Next
GoTo 100
100
MsgBox "±b¸¹¿ù»~"
'GoTo 1100 '¬°²Îpµn¤J¥¿½T©Î±j¨îµn¤J°O¿ý,¬Gµn¤J¿ù»~¤]¦C¤J¸ê®Æ
UserForm1.TextBox2.Value = ""
UserForm1.TextBox1.Value = ""
'Sheets("sheet1").Activate '°±¯d¦bµn¤J¶±ÁקK¶]¨ì±b±K¶±
Exit Sub
101
UserForm1.Hide
UserForm1.TextBox1.Value = ""
UserForm1.TextBox2.Value = ""
'Sheets("sheet1").Activate '°±¯d¦bµn¤J¶±ÁקK¶]¨ì±b±K¶±
End Sub
Private Sub CommandButton2_Click()
UserForm1.Hide
UserForm1.TextBox1.Value = ""
UserForm1.TextBox2.Value = ""
End Sub |
|