我們?cè)谟昧斜砜驎r(shí),經(jīng)常會(huì)用到多欄列表。
但怎樣取得多欄列表框第N欄的數(shù)據(jù),請(qǐng)看下面代碼:
Dim I As Integer '定義變量存儲(chǔ)被選中行的序號(hào)
For I = 0 To 列表1.ListCount - 1
If 列表1.Selected(I) Then
Exit For
End If
Next I
'報(bào)出第一欄與第二欄的值
msgbox 列表1.Column(0, I) & " " & 列表1.Column(1, I)
但怎樣取得多欄列表框第N欄的數(shù)據(jù),請(qǐng)看下面代碼:
Dim I As Integer '定義變量存儲(chǔ)被選中行的序號(hào)
For I = 0 To 列表1.ListCount - 1
If 列表1.Selected(I) Then
Exit For
End If
Next I
'報(bào)出第一欄與第二欄的值
msgbox 列表1.Column(0, I) & " " & 列表1.Column(1, I)