|
请测试。
Private Sub GetDate()
Dim i%, j%, c%, ss, n%, cr, d, x, su
Dim Arr(1 To 1000, 1 To 8)
Set d = CreateObject("scripting.dictionary")
ReDim cr(1 To 1000, 1 To 8)
With Me.ListView1
For i = 1 To .ListItems.Count
With .ListItems(i)
If .Checked Then
If .SubItems(6) = "" Then
x = x + 1
su = "]" & x
Else
su = .SubItems(6)
End If
ss = .Text & "|" & su
If Not d.Exists(ss) Then
n = n + 1
d(ss) = n
cr(n, 1) = .Text
For j = 2 To 7
cr(n, j) = .SubItems(j - 1)
Next
Else
cr(d(ss), 4) = --cr(d(ss), 4) + --.SubItems(3)
End If
End If
End With
Next
End With
j = 2
For i = 1 To n
If c + 2 > 8 Then c = 2: j = j + 3 Else c = c + 2
If cr(i, 2) = "" Then
Arr(j, c) = cr(i, 1) & "=" & cr(i, 4) & cr(i, 3)
Else
Arr(j, c) = cr(i, 1) & "(" & cr(i, 2) & ")" & "=" & cr(i, 4) & cr(i, 3)
End If
Arr(j + 1, c) = cr(i, 6) & "号箱-" & "测试" ''''''
Next
Sheet23.UsedRange.ClearContents
Sheet23.Range("a1").Resize(j + 1, 8) = Arr
End Sub |
评分
-
1
查看全部评分
-
|