|
发表于 2018-4-6 11:06
来自手机
|
显示全部楼层
费尽九牛二虎之力,终于把花名册分类给做出来了…
sub 学生花名册分类()
Dim i as integer, a as integer, b as integer, c as byte
i=3
For c=2 to 8
sheets(c).range("A3:L65536").delete
Next
Do while cells(i,)<>""
a=sheets("清镇市外").[a65536].end(xlUp).row+1
If sheets("外在本就读花名册").cells(i,8) <>"清镇") then
sheets("外在本就读花名册").range(cells(i,1),cells(i,12)).copy sheets("清镇市外").cells(a,1)
else
shtname=sheets("外在本就读花名册").cells(i,9)
b=sheets(shtname).[a65536].end(xlUP).row+1
sheets("外在本就读花名册").range(cells(i,1),cells(i,12)).copy sheets(shtname).cells(b,1)
End if
i=i+1
Loop
End sub |
|