VBA万岁 发表于 2014-4-16 14:49
能上传代码测试吗?我的电脑打开附件时代码丢失。 - Sub aa()
- R = Range("a" & Rows.Count).End(xlUp).Row
- arr = Range("a1:g" & R)
- For i = 1 To UBound(arr, 1)
- arr(i, 7) = i
- If arr(i, 3) = "" Or arr(i, 1) Like "序*" Then
- arr(i, 4) = 0
- arr(i, 5) = 0
- arr(i, 6) = 0
- End If
- Next
- brr = YjhSort(arr, "0", "1", "c,4;1;3,5;1;3,6;1;3,7;1;7", , , "-1")
- arr = Range("k1:m" & R).ClearContents
- For i = 1 To UBound(brr, 1)
- Cells(brr(i, 5), 11) = brr(i, 2)
- Cells(brr(i, 5), 12) = brr(i, 3)
- Cells(brr(i, 5), 13) = brr(i, 4)
- Next
- End Sub
复制代码 多Key数组排序(分类、统计、重复处理)-自定义函数
http://club.excelhome.net/thread-1090007-1-1.html
|