本帖最后由 yzyyyyyyy 于 2015-1-7 15:27 编辑
yjh_27 发表于 2014-12-29 20:53
1 学科分班名序,学科分班倒名序,不正确已改正
2 与你结果不一致,是因为 学科分,折算分,总分 都一 ...
大师,原始表中的数组arr为930行,6列,能否定义目标数组brr(),让数组brr()930行,30列。
原始表
1 班级
2 姓名
3 类型
4 总分
5 学科分
6 折算分
目标表
1 班级
2 姓名
3 类型
4 总分
5 学科分
6 折算分
7 学科分班名
8 学科分级名
9 学科分班序
10 学科分级序
11 学科分班倒名
12 学科分级倒名
13 学科分班倒序
14 学科分级倒序
15 总分班名
16 总分级名
17 总分班序
18 总分级序
19 总分班倒名
20 总分级倒名
21 总分班倒序
22 总分级倒序
23 折算分班名
24 折算分级名
25 折算分班序
26 折算分级序
27 折算分班倒名
28 折算分级倒名
29 折算分班倒序
30 折算分级倒序
然后再一次写入目标表
- Sub aa() '学科分
- R = Range("a" & Rows.Count).End(xlUp).Row
- arr = Range("a2:f" & R)
- 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("j2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1", "5", "R,0-5;1;12") '学科分级名
- Range("i2").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("n2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1", "5", "R,0-5;1;12") '学科分级倒名
- Range("m2").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
- End Sub
- Sub aa1() '总分
- R = Range("a" & Rows.Count).End(xlUp).Row
- arr = Range("a2:f" & R)
- brr = YjhSort(arr, "1,2", "1,4", "R,-4;1;2") '学科分班名
- Range("h2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,2,2,2", "1,4,6,4", "R,0-4;1;1") '学科分班序
- Range("j2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1", "4", "R,0-4;1;12") '学科分级名
- Range("i2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1,-1,-1", "4,6,4", "R,0-4;1;11") '学科分级序
- Range("k2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,2", "1,4", "R,4;1;2") '学科分班倒名
- Range("L2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,1,1,1", "1,4,6,4", "R,0-4;1;1") '学科分班倒序
- Range("n2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1", "4", "R,0-4;1;12") '学科分级倒名
- Range("m2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,1,1", "4,6,4", "R,0-4;1;11") '学科分级倒序
- Range("o2").Resize(UBound(brr), UBound(brr, 2)) = brr
- End Sub
- Sub aa2() '折算分
- R = Range("a" & Rows.Count).End(xlUp).Row
- arr = Range("a2:f" & R)
- brr = YjhSort(arr, "1,2", "1,6", "R,-6;1;2") '学科分班名
- Range("h2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,2,2,2", "1,6,6,6", "R,0-6;1;1") '学科分班序
- Range("j2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1", "6", "R,0-6;1;12") '学科分级名
- Range("i2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "-1,-1,-1", "6,6,6", "R,0-6;1;11") '学科分级序
- Range("k2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,2", "1,6", "R,6;1;2") '学科分班倒名
- Range("L2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,1,1,1", "1,6,6,6", "R,0-6;1;1") '学科分班倒序
- Range("n2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1", "6", "R,0-6;1;12") '学科分级倒名
- Range("m2").Resize(UBound(brr), UBound(brr, 2)) = brr
- brr = YjhSort(arr, "1,1,1", "6,6,6", "R,0-6;1;11") '学科分级倒序
- Range("o2").Resize(UBound(brr), UBound(brr, 2)) = brr
- End Sub
复制代码 |