回复 2楼 风吹过b
Sub abc()
Dim i As Integer, j As Integer, R As Integer
Dim d As Object
Dim ar, br(), m As Integer
Set d = CreateObject("Scripting.Dictionary")
R = Sheets(1).[K65536].End(3).Row
ar = Sheets(1).Range("K5:M" & R)
ReDim br(1 To UBound(ar), 1 To 2)
For i = 1 To UBound(ar)
If Not d.Exists(ar(i, 1)) Then
m = m + 1
d(ar(i, 1)) = m
br(m, 1) = ar(i, 1)
br(m, 2) = ar(i, 3)
Else
br(d(ar(i, 1)), 2) = br(d(ar(i, 1)), 2) + ar(i, 3)
End If
Next
For i = 1 To m
For j = 1 To 2
List1.AddItem brr(i, j)
Next
Next
现在listbox能正常显示数据,就是一行显示一个数据,怎么才能让每2个数据显示在一行,是不是listbox不能显示多列?
[此贴子已经被作者于2018-5-6 20:42编辑过]