- ©«¤l
- 967
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 1001
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN XP
- ³nÅ骩¥»
- OFFICE 2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-11-29
- ³Ì«áµn¿ý
- 2022-5-17
|
¦^´_ 15# donod - Option Explicit
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- Dim xX As Integer, Ar(), A As Range, B As Range, i As Integer, x As Variant
- If Target.Address(0, 0) = "Q8" Then '¿ï¾Ü¤F Q8
- Set B = Range("V9:AJ20") '¨îq B ²Õ(¤À¼Æ- PT8) ½d³ò
- xX = 0 ' QÄæ
- ElseIf Target.Address(0, 0) = "R8" Then '¿ï¾Ü¤F R8
- Set B = Range("AM9:BA20") '¨îq C²Õ(¤À¼Æ-PT8) ½d³ò
- xX = 1 ' PÄæ ¥k²¾¤@Äæ :RÄæ
- ElseIf Target.Address(0, 0) = "S8" Then '¿ï¾Ü¤F S8
- Set B = Range("BD9:BR20") '¨îq D²Õ(¤À¼Æ-PT8) ½d³ò
- xX = 2 ' PÄæ ¥k²¾¤GÄæ :SÄæ
- ElseIf Target.Address(0, 0) = "T8" Then '¿ï¾Ü¤F T8
- Set B = Range("BU9:CI20") '¨îq E²Õ(¤À¼Æ-PT8) ½d³ò
- xX = 3 ' PÄæ ¥k²¾¤TÄæ :TÄæ
- Else
- Exit Sub 'Â÷¶}µ{§Ç
- End If
- Set A = Range("G9:P20") '¨îq A ²Õ(PT1-PT8) ½d³ò
- A.Interior.ColorIndex = xlNone '²M°£A ²Õ(PT1-PT8) ½d³ò¹Ï¼Ë
- B.Interior.ColorIndex = xlNone '²M°£B ,C , D. ²Õ ½d³ò¹Ï¼Ë
- ReDim Ar(1 To A.Rows.Count) '«·s«Å§i °}¦Cªººû¼Æ
- For i = 1 To B.Rows.Count '¨ú±oB,C,D,²Õªº (PT1-PT8) ªº¤º®e ¸m¤J°}¦C Ar
- Ar(i) = Join(Application.Transpose(Application.Transpose(B(i, 6).Resize(, 10))), ",")
- Next
- For i = 1 To A.Rows.Count
- x = Join(Application.Transpose(Application.Transpose(A(i, 1).Resize(, 10))), ",")
- x = Application.Match(x, Ar, 0) '¤u§@ªí¨ç¼ÆMatch ¦bAr´M§ä ¬Û¦P¦r¦ê
- A(i, 11 + xX) = "" '²M°£
- If Not IsError(x) Then '§ä¨ì¶Ç¦^¼Æ¦r
- B(x, 6).Resize(, 10).Interior.ColorIndex = 6
- A(i, 1).Resize(, 10).Interior.ColorIndex = 6
- A(i, 11 + xX) = B(x, 1) 'B,C,D,E²Õªº¤À¼Æ
- End If
- Next
- End Sub
½Æ»s¥N½X ¥t¥~«Øij¨C±i¤u§@ªíÀ³¦³¬Û¦P¤§®æ¦¡(¥i¥H§@¨ìªº),³o¼Ë´N¥i¥H¥u¥Î¤@Ó¬¡¶Ã¯¼Ò²Õ
¦p¨C±i¤u§@ªí¤§®æ¦¡¤£¦P,¨º´Nn¨C±i¤u§@ªí¤À§O©ñ¤u§@ªí¼Ò²Õ |
|