- ©«¤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
|
¦^´_ 26# donod
¬Ý¬Ý¹ï¤£¹ï- Option Explicit
- 'ThisWorkbook ªº¹w³]¨Æ¥ó
- Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
- Dim xX As Integer, Ar(), Br(), A As Range, B As Range, i As Integer, x As Variant
- With Sh
- If Target.Address(0, 0) = "R8" Then '¿ï¾Ü¤F P7
- Set B = Range("Z9:AO9").Resize(300) '¨îq B ²Õ(³Ì³»1Ó§Q¼í- ³Ì«á³Ì©³1ÓOPT) ½d³ò
- '¦ÓSet B = .Range("V9:AJ20"), Range¤§«e ¦³ ¤@ÂI ¥Nªí¬O ¥H With Target ¬°°òÂI ©ÒÂX®iªº½d³ò
- ' B.Select ' ¥[¤W³o¦æ ¥iÅã¥Ü Bªº½d³ò¦bþ¸Ì
- xX = 0 ' PÄæ
- ElseIf Target.Address(0, 0) = "S8" Then '¿ï¾Ü¤F Q7
- Set B = Range("AR9:BG9").Resize(300) '¨îq C²Õ(³Ì³»1Ó§Q¼í- ³Ì«á³Ì©³1ÓOPT) ½d³ò
- 'B.Select
- xX = 1 ' PÄæ ¥k²¾¤@Äæ :QÄæ
- ElseIf Target.Address(0, 0) = "T8" Then '¿ï¾Ü¤F R7
- Set B = Range("BJ9:BY9").Resize(300) '¨îq D²Õ(³Ì³»1Ó§Q¼í- ³Ì«á³Ì©³1ÓOPT) ½d³ò
- xX = 2 ' PÄæ ¥k²¾¤GÄæ :RÄæ
- ElseIf Target.Address(0, 0) = "U8" Then '¿ï¾Ü¤F Q7
- Set B = Range("CB9:CQ9").Resize(300) '¨îq C²Õ(³Ì³»1Ó§Q¼í- ³Ì«á³Ì©³1ÓOPT) ½d³ò
- xX = 3 ' PÄæ ¥k²¾3Äæ :QÄæ
- ElseIf Target.Address(0, 0) = "V8" Then '¿ï¾Ü¤F R7
- Set B = Range("CT9:DI9").Resize(300) '¨îq D²Õ(³Ì³»1Ó§Q¼í- ³Ì«á³Ì©³1ÓOPT) ½d³ò
- xX = 4 ' PÄæ ¥k²¾4Äæ :RÄæ
- ElseIf Target.Address(0, 0) = "W8" Then '¿ï¾Ü¤F R7
- Set B = Range("DL9:EA9").Resize(300) '¨îq D²Õ(³Ì³»1Ó§Q¼í- ³Ì«á³Ì©³1ÓOPT) ½d³ò
- xX = 5 ' PÄæ ¥k²¾5Äæ :RÄæ
- Else
- Exit Sub 'Â÷¶}µ{§Ç
- End If
- Set A = Range("H9:Q9").Resize(50) '¨îq A ²Õ(¥þ³¡OPT) ½d³ò
- A.Interior.ColorIndex = xlNone '²M°£A ²Õ(OPT1-OPT10) ½d³ò¹Ï¼Ë
- B.Interior.ColorIndex = xlNone '²M°£B ,C , D. ²Õ ½d³ò¹Ï¼Ë
- ' ReDim Ar(1 To A.Rows.Count) '«·s«Å§i °}¦Cªººû¼Æ
- ReDim Br(1 To B.Rows.Count)
- For i = 1 To B.Rows.Count '¨ú±oB,C,D,²Õªº (OPT1-OPT10) ªº¤º®e ¸m¤J°}¦C Ar
- Br(i) = Join(Application.Transpose(Application.Transpose(B(i, 7).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, Br, 0) '¤u§@ªí¨ç¼ÆMatch ¦bAr´M§ä ¬Û¦P¦r¦ê
- A(i, 11 + xX) = "" '²M°£
- If Not IsError(x) Then '§ä¨ì¶Ç¦^¼Æ¦r
- B(x, 7).Resize(, 10).Interior.ColorIndex = 6
- A(i, 1).Resize(, 10).Interior.ColorIndex = 6
- A(i, 11 + xX) = B(x, 1) 'B,C,D,²Õªº¤À¼Æ
- End If
- Next
- End With
- End Sub
½Æ»s¥N½X |
|