Private Sub Command1_Click()
Dim a() As String
ReDim a(List1.SelCount)
For i = 0 To List1.ListCount - 1
a(j) = List1.List(i)
Next i
For i = 0 To UBound(a) - 1
Debug.Print a(i)
Next i
End Sub
通常列表框的数据,以行为一个基本数据,成为一个项,项的编号从上到下,从0开始编号,由列表框的属性:
List1.List(n)返回
其中:n = 0,1,2,3,4,5,......
Dim a(19)
For i = 0 To 19
a(i) = Val(List1.List(i))
Next
dim a(19)
for i =0 to 19
a(i)=值
next i