ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ListBox1.ColumnCount = 2®É,¦p¦óAddItem?¦p¦ó¨ú¥X?

[µo°Ý] ListBox1.ColumnCount = 2®É,¦p¦óAddItem?¦p¦ó¨ú¥X?

½Ð±Ð¦U¦ì¤j¤j
     Dim d As Object, a, b
    Set d = CreateObject("Scripting.Dictionary")
    With .Sheets("°ò¥»¸ê®Æ")
                .Visible = True
                For i = 1 To .Cells(65536, 4).End(xlUp).Row
                    d(.Cells(i, 4).Text) = .Cells(i, 5)
                Next
    End  With
    a = d.Keys
    b = d.Items
   ListBox1.ColumnCount = 2
°ÝÃD¬O:
1.AddItem®É   ¦p¦ó¨Ï    ListBox1.List (column(1) )= d.Keys  ¦Ó  column(2) AddItem¬O  d.Items
          ListBox1.List= d.Keys  ¶È¬Ocolumn(1)
2 ·í  ListBox1_Click()
   ¦p¦ó¨Ï        TextBox1 = ListBox1.Value(²Ä¤@­Ócolumn)
                       TextBox2= ListBox1.Value(²Ä¤G­Ócolumn)
Àµ½Ð«ü¾É    ÁÂÁÂ

¥»©«³Ì«á¥Ñ yangjie ©ó 2014-12-8 15:22 ½s¿è

¦^´_ 2# GBKEE
ÁÂÁÂ
¤£¥ÎDictionary ¦Ó¹F¨ì¥Øªº¡A§Ú¨ü±Ð¤F¡C
For i = 1 To .Cells(65536, 4).End(xlUp).Row
            ListBox1.AddItem
            a = ListBox1.ListCount - 1  
            ListBox1.List(a, 0) = .Cells(i, 4)
            ListBox1.List(a, 1) = .Cells(i, 5)
Next
¨ä¤¤
a = ListBox1.ListCount - 1  ¥i¯à±o¨ì -1­È
¦p¦óÁקK?

TOP

¦^´_ 2# GBKEE
½Ð±ÐGBKEEª©¤j
¦]listbox1¥Îadditem¼W¥[item¦Ó¤£¬O¥Î.referto§@list
(¦]¬°¸ê®Æ¨Ó·½¦³¿ï¾Ü©Ê(¥i¯à¬O²Ä3,4,8,12,13,14,18.....¦C)
¬G¦p¦ó³]©w©Î¥O¨Ï²Ä¤@¦Clistitem¤£°Ê,(scrollbarsÂà°Ê®É)
¤]´N¬O»¡±N²Ä¤@¦C³]©w¬°¼ÐÀYcolumnheads(©ÎÃþ¦ü)
·q½Ð«ü¾É  ÁÂÁÂ

TOP

¥»©«³Ì«á¥Ñ yangjie ©ó 2014-12-24 17:31 ½s¿è

¦^´_ 6# GBKEE
ÁÂÁÂGBKEEª©¤j
ListBox2.Clear
    wb1.Activate
    With Sheets("·s¥Í¸ê®Æ")
        If TextBox11 = 0 Then
            row1 = .Cells(65536, 5).End(xlUp).Row
            If row1 < 2 Then Exit Sub
            Dim mystr As String
            With Application.Names.Add("Tmp", .Range(.Cells(2, 1), .Cells(row1 - 5, 11)))
                mystr = .RefersTo
                .Delete
            End With
            With ListBox2
                .ColumnCount = 11
                .RowSource = mystr
                .ColumnHeads = True
            End With
'­n¥[¤J.Range(.Cells(row1 - 1, 1), .Cells(row1 - 1, 11))
            With ListBox2
                .AddItem
                .RowSource = .Range(.Cells(row1 - 1, 1), .Cells(row1 - 1, 11))
            End With
      End With
°»¿ù»¡:¨S¦³¦¹¦¨­û©Î....µLªk¥[¤J ©Î²¾°£³¡¤À
¥t¦³¤@°ÝÃD  ·íListBox2_Click
MsgBox ListBox2.List(ListIndex, 3)
MsgBox ListBox2.List(ListIndex, ?)¦p¦ó¥i§ä¥X¸Ó¦Cªº Row?

TOP

        ÀR«ä¦Û¦b : ¦³´¼¼z¤~¯à¤À¿ëµ½´c¨¸¥¿¡F¦³Á¾µê¤~¯à«Ø¥ß¬üº¡¤H¥Í¡C
ªð¦^¦Cªí ¤W¤@¥DÃD