- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 5# donod
½Ð½Æ»s¨ìThisWorkbook¼Ò²Õ¤º- 'ThisWorkbook ªº¹w³]¨Æ¥ó
- Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
- Dim xX As Integer, Ar(), A As Range, B As Range, i As Integer, x As Variant
- With Sh
- If Target.Address(0, 0) = "P7" Then '¿ï¾Ü¤F P7
- Set B = .Range("T10:AE21") '¨îq B ²Õ(¤À¼Æ- PT8) ½d³ò
- xX = 0 ' PÄæ
- ElseIf Target.Address(0, 0) = "Q7" Then '¿ï¾Ü¤F Q7
- Set B = .Range("AH10:AS21") '¨îq C²Õ(¤À¼Æ-PT8) ½d³ò
- xX = 1 ' PÄæ ¥k²¾¤@Äæ :QÄæ
- ElseIf Target.Address(0, 0) = "R7" Then '¿ï¾Ü¤F R7
- Set B = .Range("AV10:BG21") '¨îq D²Õ(¤À¼Æ-PT8) ½d³ò
- xX = 2 ' PÄæ ¥k²¾¤GÄæ :RÄæ
- Else
- Exit Sub 'Â÷¶}µ{§Ç
- End If
- Set A = .Range("H10:O21") '¨î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, 5).Resize(, 8))), ",")
- Next
- For i = 1 To A.Rows.Count
- x = Join(Application.Transpose(Application.Transpose(A(i, 1).Resize(, 8))), ",")
- x = Application.Match(x, Ar, 0) '¤u§@ªí¨ç¼ÆMatch ¦bAr´M§ä ¬Û¦P¦r¦ê
- A(i, 9 + xX) = "" '²M°£
- If Not IsError(x) Then '§ä¨ì¶Ç¦^¼Æ¦r
- B(x, 5).Resize(, 8).Interior.ColorIndex = 6
- A(i, 1).Resize(, 8).Interior.ColorIndex = 6
- A(i, 9 + xX) = B(x, 1) 'B,C,D,²Õªº¤À¼Æ
- End If
- Next
- End With
- End Sub
½Æ»s¥N½X |
|