- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-11-28
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2024-1-15 10:11 ½s¿è
¦^´_ 1# wayne0303
ÁÂÁ«e½úµoªí¦¹¥DÃD
µ{§Ç°õ¦æ¥i¥H¥Î,¥i¥H¥¿½T°õ¦æ³Ì«n,¦pªG¯à©ú½T«ü¥X°ÝÃDÄpµ²©Î¤W¶Ç½d¨Ò,¤ñ¸û®e©ö²z¸Ñ»Ý¨D
«e½ú´£¨Ñ½d¨Ò²z¸Ñ¦p¤U:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'¡ôÀx¦s®æ¤º®e§ïÅܪºÄ²µo¨Æ¥ó
Dim xA As Range, xR As Range
'¡ô«Å§iÅܼÆ
Application.ScreenUpdating = False
'¡ô¿Ã¹õ¼È¤£ÀHµ{§Ç§ïÅܵ²ªG
Set xA = Intersect(Target, Range("U:U"))
'¡ô¥OxAÅܼƬOIJµo®æ»PUÄ檺¥æ¶°Àx¦s®æ
If xA Is Nothing Then GoTo xA0
'¡ô¦pªGxAÅܼƨS¥æ¶°¨ì¥ô¦óÀx¦s®æ!´N¸õ¨ì¼Ð¥ÜxA0¦ì¸mÄ~Äò°õ¦æ
For Each xR In xA
'¡ô³]³v¶µ°j°é!¥OxRÅܼƬOxA³o¥æ¶°®æªº¤@®æ
Range(Cells(xR.Row, 1), Cells(xR.Row, 22)).Font.ColorIndex = 15 ^ -(xR > 1)
'¡ô¥OÀx¦s®æ¤å¦rÃC¦â¬O¦Ç¦â©Î¶Â¦â
'Àx¦s®æ:xR·í¦CAÄæ¨ìVÄ椧¶¡ªº³sÄòÀx¦s®æ
Next
xA0:
Set xA = Intersect(Target, Range("O:O"))
'¡ô¥OxAÅܼƬOIJµo®æ»POÄ檺¥æ¶°Àx¦s®æ
If xA Is Nothing Then GoTo xA1
'¡ô¦pªGxAÅܼƨS¥æ¶°¨ì¥ô¦óÀx¦s®æ!´N¸õ¨ì¼Ð¥ÜxA1¦ì¸mÄ~Äò°õ¦æ
For Each xR In xA
'¡ô³]³v¶µ°j°é!¥OxRÅܼƬOxA³o¥æ¶°®æªº¤@®æ
Range(Cells(xR.Row, 16), xR).Font.ColorIndex = 2 ^ -(xR = "")
'¡ô¥OÀx¦s®æ¤å¦rÃC¦â¬O¥Õ¦â©Î¶Â¦â
'Àx¦s®æ:xR·í¦COÄæ¨ìPÄ椧¶¡ªº³sÄòÀx¦s®æ
Next
xA1:
Set xA = Intersect(Target, Range("J:J"))
'¡ô¥OxAÅܼƬOIJµo®æ»PJÄ檺¥æ¶°Àx¦s®æ
If xA Is Nothing Then GoTo xA2
'¡ô¦pªGxAÅܼƨS¥æ¶°¨ì¥ô¦óÀx¦s®æ!´N¸õ¨ì¼Ð¥ÜxA2¦ì¸mÄ~Äò°õ¦æ
For Each xR In xA
'¡ô³]³v¶µ°j°é!¥OxRÅܼƬOxA³o¥æ¶°®æªº¤@®æ
Range(Cells(xR.Row, 10), xR).Font.Color = RGB(0, 176, 240) ^ -(xR = "L")
Range(Cells(xR.Row, 10), xR).Font.Bold = (xR = "L")
'¡ô¥OÀx¦s®æ¤å¦rÃC¦â¬O²LÂŦâ©Î¶Â¦â,¥OÀx¦s®æ¤å¦r¬O²ÊÅé©Î«D²ÊÅé
'Àx¦s®æ:xR·í¦CJÄæÀx¦s®æ
Next
xA2:
Set xA = Intersect(Target, Range("v:v"))
'¡ô¥OxAÅܼƬOIJµo®æ»PVÄ檺¥æ¶°Àx¦s®æ
If xA Is Nothing Then GoTo xA3
'¡ô¦pªGxAÅܼƨS¥æ¶°¨ì¥ô¦óÀx¦s®æ!´N¸õ¨ì¼Ð¥ÜxA3¦ì¸mÄ~Äò°õ¦æ
For Each xR In xA
'¡ô³]³v¶µ°j°é!¥OxRÅܼƬOxA³o¥æ¶°®æªº¤@®æ
Range(Cells(xR.Row, 1), xR).Font.Color = RGB(153, 102, 0) ^ -((xR Like "*©î¹Ï"))
'¡ô¥OÀx¦s®æ¤å¦rÃC¦â¬O¤g¦â©Î¶Â¦â
'Àx¦s®æ:xR·í¦CAÄæ¨ìVÄ椧¶¡ªº³sÄòÀx¦s®æ
Next
xA3:
Set xA = Intersect(Target, Range("p:p"))
'¡ô¥OxAÅܼƬOIJµo®æ»PPÄ檺¥æ¶°Àx¦s®æ
If xA Is Nothing Then GoTo xA4
'¡ô¦pªGxAÅܼƨS¥æ¶°¨ì¥ô¦óÀx¦s®æ!´N¸õ¨ì¼Ð¥ÜxA4¦ì¸mÄ~Äò°õ¦æ
For Each xR In xA
'¡ô³]³v¶µ°j°é!¥OxRÅܼƬOxA³o¥æ¶°®æªº¤@®æ
Range(Cells(xR.Row, 1), Cells(xR.Row, 22)).Font.ColorIndex = 5 ^ -(xR.Font.Strikethrough = True)
'¡ô¥OÀx¦s®æ¤å¦rÃC¦â¬OÂŦâ©Î¶Â¦â
'Àx¦s®æ:xR·í¦CAÄæ¨ìVÄ椧¶¡ªº³sÄòÀx¦s®æ
Next
xA4:
Set xA = Intersect(Target, Range("E:E"))
'¡ô¥OxAÅܼƬOIJµo®æ»PEÄ檺¥æ¶°Àx¦s®æ
If xA Is Nothing Then Exit Sub
'¡ô¦pªGxAÅܼƨS¥æ¶°¨ì¥ô¦óÀx¦s®æ!´Nµ²§ôµ{¦¡°õ¦æ
Dim st As String
Dim cell As Range
'¡ô«Å§iÅܼÆ
For Each cell In Me.Range("E2:E" & Me.Cells(Me.Rows.Count, "E").End(3).Row)
'¡ô³]³v¶µ°j°é!¥OcellÅܼƬO¥»ªíEÄæ¸ÌªºÀx¦s®æ
st = IIf(cell.Value = "", "", _
IIf(cell.Offset(0, -1).Value > 0, "LOB", _
IIf(Application.WorksheetFunction.CountIf(cell, "S1A*") > 0, "TM", "MU")))
'¡ô¥OstÅܼƬOIIf()¦^¶ÇÈ
cell.Offset(0, -3).Value = st
'¡ô¥OcellÅܼƥª3®æÀx¦s®æȬOstÅܼÆ
Next
End Sub |
|