- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-9-6 16:47 ½s¿è
¦^´_ 67# v03586
EX: ×¥¿´£®× by 2016/9/5 v03586
°²³] 1ST Á`¤H¤O 75¤H V ²Õ 25¤H , P ²Õ 23¤H , K²Õ 26¤H¡C
¤µ¤ÑÂ÷¾¤@¦ì 1ST K ²Õ¤Hû, ÂI¿ï¤Hû¦^³ø¥\¯àÁä«á¡F
Á`¤H¤OÀ³¸Ó¥Ñ 75¤HÅÜ§ó¬° 74, K ²ÕÀ³¦P®É½Õ¾ã²§°Ê¬° 25¤H¡C
ªí³æ (DA½s¿è¤Hû):- Option Explicit
- Dim ´_¾ºX¼Ð As Boolean ' ¦p¸Óû·~¤wÂ÷¾¡A¦Ó©ó¨Æ«á¤S¥Ó½Ð´_¾
- Private Sub ²§°Ê¯Z§O_Click()
- If ²§°Ê¯Z§O.Value = True Then
- ²§°Ê_¯Z§O.Enabled = True
- Else
- ²§°Ê_¯Z§O.Enabled = False
- End If
- End Sub
- Private Sub ²§°Ê©ÒÄÝ»â¯Z_Click()
- If ²§°Ê©ÒÄÝ»â¯Z.Value = True Then
- ²§°Ê»â¯Z.Enabled = True
- Else
- ²§°Ê»â¯Z.Enabled = False
- End If
- End Sub
- Private Sub ±Mªø_Change()
- Dim ar As Variant, sp As Variant
-
- ar = Array("DA", "Sub", "EC", "PL", "MH", "PT", "¥N²z¤H")
- ±Mªø1.Clear
- ±Mªø2.Clear
-
- For Each sp In ar
- If sp <> ±Mªø Then ±Mªø1.AddItem sp
- Next
- End Sub
- Private Sub ¯Z§O_Change()
- »â¯Z.Clear
-
- If ¯Z§O = "1ST" Then ' 1ST »â¯Z
- »â¯Z.AddItem "§º¤p¤p"
- »â¯Z.AddItem "ªL¤p¤p"
- End If
-
- If ¯Z§O = "2ND" Then ' 2ND »â¯Z
- »â¯Z.AddItem "½²¤p¤p"
- »â¯Z.AddItem "¬x¤p¤p"
- End If
-
- If ¯Z§O = "3RD" Then ' 3RD »â¯Z
- »â¯Z.AddItem "ÃC¤p¤p"
- »â¯Z.AddItem "ªL¤¤¤p"
- End If
- End Sub
- Private Sub ±Mªø1_Change()
- Dim ar As Variant, sp As Variant
-
- ar = Array("DA", "Sub", "EC", "PL", "MH", "PT", "¥N²z¤H")
- ±Mªø2.Clear
-
- For Each sp In ar
- If sp <> ±Mªø And sp <> ±Mªø1 Then ±Mªø2.AddItem sp
- Next
- End Sub
- Private Sub ²§°Ê_¯Z§O_Change()
- ²§°Ê»â¯Z.Clear
-
- If ²§°Ê_¯Z§O = "1ST" Then ' ²§°Ê 1ST »â¯Z
- ²§°Ê»â¯Z.AddItem "§º¤p¤p"
- ²§°Ê»â¯Z.AddItem "ªL¤p¤p"
- End If
-
- If ²§°Ê_¯Z§O = "2ND" Then ' ²§°Ê 2ND »â¯Z
- ²§°Ê»â¯Z.AddItem "½²¤p¤p"
- ²§°Ê»â¯Z.AddItem "¬x¤p¤p"
- End If
-
- If ²§°Ê_¯Z§O = "3RD" Then ' ²§°Ê 3RD »â¯Z
- ²§°Ê»â¯Z.AddItem "ÃC¤p¤p"
- ²§°Ê»â¯Z.AddItem "ªL¤¤¤p"
- End If
- End Sub
- Private Sub ´_¾_Click()
- If Len(¤Hû¤u¸¹.Text) = 4 And ´_¾ Then ¶ñ¤J¸ê®Æ
- End Sub
- Private Sub ½T»{_Click()
- Dim Rng As Range, sh As Range, i As Integer
-
- With Worksheets("¤H¤O¸ê®Æ®w")
- Set Rng = .Range("C:C").Find(¤Hû¤u¸¹.Value, LookIn:=xlValues, LookAt:=xlWhole)
- If Not Rng Is Nothing Then ' ¤Hû¤u¸¹¤w¦s¦b
- If ²§°Ê¯Z§O.Value = True And (²§°Ê_¯Z§O.Value = "" Or ²§°Ê_¯Z§O.Value = "½Ð¿ï¾Ü") Then
- MsgBox "¤Ä¿ï²§°Ê¯Z§O¡A½Ð¿ï¾Ün²§°Êªº¯Z§O!"
- Exit Sub
- ElseIf ²§°Ê¯Z§O.Value = True Then
- .Cells(Rng.Row, 1) = ²§°Ê_¯Z§O.Value
- ElseIf ²§°Ê¯Z§O.Value = False Then
- .Cells(Rng.Row, 1) = ¯Z§O.Value
- End If
-
- If ²§°Ê©ÒÄÝ»â¯Z.Value = True And (²§°Ê_¯Z§O.Value = "" Or ²§°Ê_¯Z§O.Value = "½Ð¿ï¾Ü") Then
- MsgBox "¤Ä¿ï²§°Ê²§°Ê©ÒÄÝ»â¯Z¡A½Ð¿ï¾Ün²§°Êªº»â¯Z!"
- Exit Sub
- ElseIf ²§°Ê©ÒÄÝ»â¯Z.Value = True Then
- .Cells(Rng.Row, 2) = ²§°Ê»â¯Z.Value
- ElseIf ²§°Ê©ÒÄÝ»â¯Z.Value = False Then
- .Cells(Rng.Row, 2) = »â¯Z.Value
- End If
-
- .Cells(Rng.Row, 3) = ¤Hû¤u¸¹.Value ' ¤u¸¹
- .Cells(Rng.Row, 4) = ©m¦W.Value ' ©m¦W
-
- If V.Value = True Then
- .Cells(Rng.Row, 5) = "V"
- ElseIf P.Value = True Then
- .Cells(Rng.Row, 5) = "P"
- ElseIf K.Value = True Then
- .Cells(Rng.Row, 5) = "K"
- End If
-
- .Cells(Rng.Row, 6) = ¨ì¾¤é.Value ' ¨ì¾¤é
- .Cells(Rng.Row, 7) = ±Mªø.Value ' ¥Dn±Mªø
- .Cells(Rng.Row, 8) = ±Mªø1.Value ' ±Mªø1
- .Cells(Rng.Row, 9) = ±Mªø2.Value ' ±Mªø2
-
- Set sh = Worksheets("¤Hû¦^³ø").[D4]
- If .Cells(Rng.Row, 1) = "2ND" Then ' ¯Z§O
- Set sh = sh.Offset(23) ' = [D27]
- ElseIf .Cells(Rng.Row, 1) = "3RD" Then
- Set sh = sh.Offset(46) ' = [D50]
- End If
- If Â÷¾ = True Then
- ' Rows(rng.Row & ":" & rng.Row).Select
- ' Selection.Delete Shift:=xlUp
- ' Sheets("¾Þ§@¤¶±").Select
- ' û¤u½ÐÃã«á¡A¨äû¤u¸ê®Æ¼È¤£¤©¥H§R°£¡F¥u¦b¡u³ÆµùÄæ¡v¤º°O¸ü¡uÂ÷¾¡v¨Æ¹ê¡C
- .Cells(Rng.Row, 10) = "¸Óû¤w©ó " & Format(Date, "YY/MM/DD") & " Â÷¾"
- sh.Offset(1, 1) = sh.Offset(1, 1) - 1
- i = Application.Match(UCase(.Cells(Rng.Row, 5)), Array("V", "P", "K"), 0) ' **Âk¯Ç²Õ§O
- sh.Offset(i) = sh.Offset(i) - 1
- Else
- If ´_¾ºX¼Ð = True Then
- sh.Offset(1, 1) = sh.Offset(1, 1) + 1
- i = Application.Match(UCase(.Cells(Rng.Row, 5)), Array("V", "P", "K"), 0) ' **Âk¯Ç²Õ§O
- sh.Offset(i) = sh.Offset(i) + 1
- ´_¾ºX¼Ð = False
- End If
-
- .Cells(Rng.Row, 10) = ³Æµù.Value ' Remark
- End If
- End If
- End With
-
- Call ²MªÅ_Click
- MsgBox "¸ê®Æ²§°Ê§¹¦¨"
- End Sub
- Private Sub ²MªÅ_Click()
- ¨ì¾¤é.Value = ""
- ³Æµù.Value = ""
- ¤Hû¤u¸¹.Value = ""
- ©m¦W.Value = ""
- ¯Z§O.Value = ""
- »â¯Z.Value = ""
- ±Mªø.Value = ""
- ±Mªø1.Value = ""
- ±Mªø2.Value = ""
- Â÷¾.Value = False
- ¤Hû¤u¸¹.Enabled = True
- ½T»{.Enabled = False
- End Sub
- Private Sub ¨ú®ø_Click()
- Unload Me
- End Sub
- Private Sub ¶ñ¤J¸ê®Æ()
- Dim Rng As Range
-
- ´_¾ºX¼Ð = False
-
- With Worksheets("¤H¤O¸ê®Æ®w")
- Set Rng = .Range("C:C").Find(¤Hû¤u¸¹.Value, LookIn:=xlValues, LookAt:=xlWhole)
- If Not Rng Is Nothing Then ' ¤Hû¤u¸¹¤w¦s¦b
- If InStr(.Cells(Rng.Row, 10), "Â÷¾") > 0 And ´_¾ = False Then ' Remark
- ©m¦W.Value = .Cells(Rng.Row, 4) ' ©m¦W
- MsgBox .Cells(Rng.Row, 10)
- ´_¾.Enabled = True
- ©m¦W.Value = ""
- Exit Sub
- End If
- If ´_¾ Then .Cells(Rng.Row, 10) = "¸Óû¤w©ó " & Format(Date, "YY/MM/DD") & " ´_¾": ´_¾ºX¼Ð = True
- ³Æµù.Value = .Cells(Rng.Row, 10) ' Remark
-
- ´_¾ = False
- ´_¾.Enabled = False
- Â÷¾ = False
-
- ¯Z§O.Value = .Cells(Rng.Row, 1) ' ¯Z§O
- »â¯Z.Value = .Cells(Rng.Row, 2) ' »â¯Z
- ¤Hû¤u¸¹.Value = .Cells(Rng.Row, 3) ' ¤u¸¹
- ©m¦W.Value = .Cells(Rng.Row, 4) ' ©m¦W
-
- If .Cells(Rng.Row, 5) = "V" Then
- V.Value = True
- ElseIf .Cells(Rng.Row, 5) = "P" Then
- P.Value = True
- ElseIf .Cells(Rng.Row, 5) = "K" Then
- K.Value = True
- End If
-
- ¨ì¾¤é.Value = .Cells(Rng.Row, 6) ' ¨ì¾¤é
- ±Mªø.Value = .Cells(Rng.Row, 7) ' ¥Dn±Mªø
- ±Mªø1.Value = .Cells(Rng.Row, 8) ' ±Mªø1
- ±Mªø2.Value = .Cells(Rng.Row, 9) ' ±Mªø2
- ¤Hû¤u¸¹.Enabled = False
- ½T»{.Enabled = True
- ' MsgBox "¸ê®Æ¬d¸ß§¹¦¨"
- Else
- ´_¾ = False
- ´_¾.Enabled = False
- MsgBox "¬dµL¸Óû¤u¸ê®Æ"
- End If
- End With
- End Sub
- Private Sub ¤Hû¤u¸¹_Change()
- ¤Hû¤u¸¹.Text = UCase(¤Hû¤u¸¹.Text)
- If Len(¤Hû¤u¸¹.Text) = 4 Then ¶ñ¤J¸ê®Æ
- End Sub
- Private Sub UserForm_Initialize()
- ¯Z§O.AddItem "1ST"
- ¯Z§O.AddItem "2ND"
- ¯Z§O.AddItem "3RD"
-
- ²§°Ê_¯Z§O.AddItem "1ST"
- ²§°Ê_¯Z§O.AddItem "2ND"
- ²§°Ê_¯Z§O.AddItem "3RD"
-
- ±Mªø.AddItem "DA"
- ±Mªø.AddItem "Sub"
- ±Mªø.AddItem "EC"
- ±Mªø.AddItem "PL"
- ±Mªø.AddItem "MH"
- ±Mªø.AddItem "PT"
- ±Mªø.AddItem "¥N²z¤H"
- ´_¾.Enabled = False
- ´_¾ºX¼Ð = False
- End Sub
½Æ»s¥N½X |
|