|
楼主 |
发表于 2017-10-31 16:40
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 教父01 于 2017-11-1 09:53 编辑
请问老师,调整后与调整前的区别是什么呢?还请不吝赐教!!!
是不是后三个问题的这部分:
ReDim brr(1 To UBound(arr) * UBound(arr, 2), 1 To 2)a = 1
For i = 1 To UBound(arr, 2)
For j = 2 To UBound(arr)
If arr(j, i) <> "" Then
If arr(j, i) >= 0 Then
brr(a, 1) = arr(1, i)
n = n + 1
Else
brr(a, 1) = arr(1, i)
brr(a, 2) = n
n = 0
a = a + 1
End If
End If
Next
brr(a, 1) = arr(1, i)
brr(a, 2) = n
n = 0
a = a + 1
Next
arr1 = brr
ar = Application.Index(brr, 0, 2)
For i = 1 To UBound(brr)
If brr(i, 1) = "" Then Exit For
n = Application.Match(Application.Max(ar), ar, 0)
For j = 1 To 2
arr1(i, j) = brr(n, j)
Next j
ar(n, 1) = ""
Next i
Frequency5 = arr1(1, 1) & arr1(1, 2) & "|" & arr1(2, 1) & arr1(2, 2) & "|" & arr1(3, 1) & arr1(3, 2)
调整为:
ReDim brr(1 To UBound(arr, 2), 1 To 2)
For i = 1 To UBound(arr, 2)
If Not d.exists(arr(1, i)) Then
d(arr(1, i)) = i
brr(d(arr(1, i)), 1) = arr(1, i)
For j = 2 To UBound(arr)
If arr(j, i) <> "" Then
If arr(j, i) >= 0 Then
n = n + 1
Else
If brr(d(arr(1, i)), 2) <= n Then brr(d(arr(1, i)), 2) = n: n = 0
End If
End If
Next
End If
If brr(d(arr(1, i)), 2) <= n Then brr(d(arr(1, i)), 2) = n: n = 0
Next
arr1 = brr
ar = Application.Index(brr, 0, 2)
For i = 1 To UBound(brr)
If brr(i, 1) = "" Then Exit For
n = Application.Match(Application.Max(ar), ar, 0)
For j = 1 To 2
arr1(i, j) = brr(n, j)
Next j
ar(n, 1) = ""
其他的还有吗?
|
|