- ©«¤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
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2018-12-30 07:40 ½s¿è
¦^´_ 1# man65boy
ÅçÃÒµøµ¡µLªkÅܤj
קï§AªºVBA ¸Õ¸Õ¬Ý- Option Explicit
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- With ComboBox1
- '**Target > ¨Æ¥ó©Ò¶Ç¦^ªº¦ì¸m
- If Not Intersect(Target, [a2:b2]) Is Nothing Then
- Ex_ComboBox_list Target.Address(0, 0) '**©I¥sµ{¦¡ . ¶Ç°e°Ñ¼Æ
- .Left = Target.Left
- .Top = Target.Top
- .Width = Target.Width + 15
- .Height = Target.Height + 3
- .LinkedCell = Target.Address
- '§ï¥Î List ****
- '.ListFillRange = StrVdFml
- '***************
- .Visible = 1
- .Object.SpecialEffect = 3
- .Object.Font.Size = Target.Font.Size
- Else
- .Visible = False
- End If
- End With
- End Sub
- Private Sub Ex_ComboBox_list(Target As String) 'vu. קï§ï¥Î List
- Dim Ar(), i As Variant 'Sheet2
- With Sheets("Sheet2").Range("A1") '**²Ä¤@¼hªºÄæ¦ì¦V¥kªº¸ê®Æ
- Ar = Application.Transpose(Application.Transpose(Sheets("Sheet2").Range(.Cells, .Cells.End(xlToRight)).Value))
- End With
- Select Case Target
- Case "A2"
- ComboBox1.List = Ar
- Case "B2"
- i = Application.Match(Range("a2"), Ar, 0) '²Ä¤@¼hªº¿ï¾Ü** Match ¶Ç¦^²Ä¤G¼hªºÄæ¦ì
- If IsError(i) Then ' '***** ¨¾§b******
- MsgBox IIf(Range("a2") = "", "A2 ¨S¿é ¤J... ", Range("a2")) & vbLf & "--¤£¦b-- .." & vbLf & Join(Ar, ",")
- ComboBox1.Clear
- Else
- With Sheets("Sheet2").Cells(2, i) '²Ä¤G¼hªºÄæ¦ìªº²Ä¤G¦C
- Ar = Sheets("Sheet2").Range(.Cells, .Cells.End(xlDown)).Value
- End With
- ComboBox1.List = Ar
- End If
- End Select
- End Sub
½Æ»s¥N½X |
|