yjh_27 发表于 2015-1-7 16:36
1 sub aa1 '总分
sub aa2 '折算分
的输出列按需要对应改,如
感谢大师热心帮助,不知如何写入crr(),请大师再次出手
brr = YjhSort(arr, "-1", "5", "R,0-5;1;12") '学科分级名
brr = YjhSort(arr, "-1", "5", "R,0--5;1;12") '学科分级名
红色部分有区别吗,多了一个杠- Sub aa()
- dim arr,brr,crr()
- '学科分
- R = Range("a" & Rows.Count).End(xlUp).Row
- arr = Range("a2:f" & R)
- redim crr(ubound(arr),30)
- brr = YjhSort(arr, "1,2", "1,5", "R,-5;1;2") '学科分班名
- Range("h2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,2,2,2", "1,5,6,4", "R,0-5;1;1") '学科分班序
- Range("I2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1", "5", "R,0--5;1;12") '学科分级名
- Range("J2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1,-1,-1", "5,6,4", "R,0-5;1;11") '学科分级序
- Range("k2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,2", "1,5", "R,5;1;2") '学科分班倒名
- Range("L2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,1,1,1", "1,5,6,4", "R,0-5;1;1") '学科分班倒序
- Range("M2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1", "5", "R,0-5;1;12") '学科分级倒名
- Range("N2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,1,1", "5,6,4", "R,0-5;1;11") '学科分级倒序
- Range("o2").Resize(UBound(brr), UBound(brr, 2)) = brr
- '总分
- brr = YjhSort(arr, "1,2", "1,4", "R,-4;1;2") '总分班名
- Range("P2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,2,2,2", "1,4,6,4", "R,0-4;1;1") '总分班序
- Range("Q2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1", "4", "R,0--4;1;12") '总分级名
- Range("R2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1,-1,-1", "4,6,4", "R,0-4;1;11") '总分级序
- Range("S2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,2", "1,4", "R,4;1;2") '总分班倒名
- Range("T2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,1,1,1", "1,4,6,4", "R,0-4;1;1") '总分班倒序
- Range("U2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1", "4", "R,0-4;1;12") '总分级倒名
- Range("V2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,1,1", "4,6,4", "R,0-4;1;11") '总分级倒序
- Range("W2").Resize(UBound(brr), UBound(brr, 2)) = brr
- '折算分
- brr = YjhSort(arr, "1,2", "1,6", "R,-6;1;2") '折算分班名
- Range("X2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,2,2,2", "1,6,6,6", "R,0-6;1;1") '折算分班序
- Range("Y2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1", "6", "R,0--6;1;12") '折算分级名
- Range("Z2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1,-1,-1", "6,6,6", "R,0-6;1;11") '折算分级序
- Range("AA2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,2", "1,6", "R,6;1;2") '折算分班倒名
- Range("AB2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,1,1,1", "1,6,6,6", "R,0-6;1;1") '折算分班倒序
- Range("AC2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1", "6", "R,0-6;1;12") '折算分级倒名
- Range("AD2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,1,1", "6,6,6", "R,0-6;1;11") '折算分级倒序
- Range("AE2").Resize(UBound(brr), UBound(brr, 2)) = brr
- End Sub
复制代码 |