ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ªí³æ_·s¼W¸ê®Æ ­«½Æ¿é¤J°ÝÃD

[µo°Ý] ªí³æ_·s¼W¸ê®Æ ­«½Æ¿é¤J°ÝÃD

§Ú¦bªí³æ¤W³]¤F¤@­Ó·s¼W«ö¶s¡A¦pªG¤£¤p¤ß³sÄò«ö¤F¦n´X¦¸-.-
¸ê®Æ´N·|·s¼W¤F¦n´Xµ§¡A½Ð°Ý­n¦p¦óÁקK­«½Æ·s¼W¸ê®Æªº°ÝÃD??
'­û¤u½s¸¹¤£­«½Æ
Private Sub no_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    Sheets("¤H¨Æ¸ê®Æ").Select
    If KeyCode = vbKeyTab Or KeyCode = vbKeyReturn Then
        If no.Text <> "" And Application.WorksheetFunction.CountIf(Columns(1), no.Text) >= 1 Then
        no.Text = ""
        KeyCode = 0
        End If
    End If
End Sub
'·s¼W¤H¨Æ¸ê®Æ
Private Sub add_Click()
Sheets("¤H¨Æ¸ê®Æ").Select
    Range("A1").Select
    Range("A65536").Select
    Selection.End(xlUp).Select
    ActiveCell.Offset(0, 0).Range("A2") = no.Text
    ActiveCell.Offset(0, 0).Range("B2") = fullname.Text
    ActiveCell.Offset(0, 0).Range("c2") = birthday.Text
    ActiveCell.Offset(0, 0).Range("d2") = id.Text
End Sub

§Ú¦³·Q¨ì¤TºØ¤èªk :
1. ³]­Ó¥þ°ìÅܼÆ(¦]¬°¨C¦¸©I¥s¨ç¼Æ³£·|²M±¼°Ï°ìÅܼÆ)Àx¦s¤W¦¸·s¼Wªº "­û¤u½s¸¹",
µM«á¦b·s¼W¸ê®Æªº¨ç¼Æ¤¤§PÂ_­n·s¼Wªº "­û¤u½s¸¹" »P¤W¦¸¬Û²§¤~°µ·s¼W§@·~.
2. ±N¤W¦¸·s¼Wªº "­û¤u½s¸¹" ©ñ¦b¥ô¤@¤£¼vÅT©Î¬Ý¤£¨ìªºÀx¦s®æ¤º¦s©ñ,¨ä¾l¦P¤W.
3. ¦b©I¥s·s¼W¸ê®Æªº¨ç¼Æ¦P®É¶Ç¤J¤W¦¸·s¼Wªº "­û¤u½s¸¹" ,¨ä¾l¦P¤W.

TOP

'°²设 ID.Text¬O"员¤u编号",¥ý对 ID.Text进¦æ§P断,¬O§_¦bd¦C¦s¦b.
Private Sub add_Click()
    With Sheets("¤H¨Æ¸ê®Æ")
        If Application.WorksheetFunction.CountIf(.Range("d:d"), ID.Text) > 0 Then
            MsgBox "员¤u编号¤w¦s¦b!", vbCritical, "错误"
            Exit Sub
        End If
        With .Range("A65536").End(xlUp)
            .Range("A2") = no.Text
            .Range("B2") = FullName.Text
            .Range("c2") = birthday.Text
            .Range("d2") = ID.Text
        End With
    End With
End Sub
'没¦³ªþ¥ó,没¦³验证过«¢.´£问³Ì¦n­n¦³ªþ¥ó

TOP

¦^´_ 2# luhpro
ÁÂÁ±z´£¨Ñªº¤èªkXD

TOP

¦^´_ 3# et5323
±zªº¤èªk¡A§Ú¸Õ¤F¡A¤w¸gOK¡A·PÁ±z¡I
¦ü¥G ID¨úETªº¤H³£«Ü¼F®`XD
¨S¦³¤W¶Çªþ¥ó¡A¬O¦]¬°§ÚªºÀÉ®×....¦³¤Ó¦h°ÝÃD¤FXDD

TOP

        ÀR«ä¦Û¦b : ÀR§¤±`®¦¤v¹L¡B¶¢½Í²ö½×¤H«D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD