|
楼主 |
发表于 2024-3-26 16:31
|
显示全部楼层
就像下面的这个均衡分班正式版3.1,钩选了生成班级分表就会把每1个班级列出来,没有的话就不出现。
'拆分独立名册部分
Application.DisplayAlerts = False
Application.ScreenUpdating = False
For Each ws In Worksheets
If ws.Name <> "报名信息" And ws.Name <> "分班设置" And ws.Name <> "分班结果" And Left(ws.Name, 1) <> "源" Then ws.Delete
Next
If Sheets("分班设置").CheckBox2 Then
arr = YjhSort1(arr, 1, fb_jgl)
arri = arr
i1 = 1
For i = 1 To fbs
With Sheets.Add(After:=Sheets(Sheets.Count))
.Name = i & "班"
End With
Sheets("分班结果").Cells.Copy Sheets(i & "班").Range("A1")
Sheets(i & "班").Range(R0 + tj(0).xiangmu(2, 3 + i) & ":" & Rows.Count).Delete Shift:=xlUp
i2 = 0
For ii = i1 To tj(0).xiangmu(2, 3 + i) + i1 - 1
i2 = i2 + 1
For j = 1 To UBound(arr, 2)
arri(i2, j) = arr(ii, j)
Next
Next
Sheets(i & "班").Range("A" & R0).Resize(tj(0).xiangmu(2, 3 + i), UBound(arr, 2)) = arri
i1 = i1 + tj(0).xiangmu(2, 3 + i)
Next
Sheet1.Select
End If
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "开始:" & t & Chr(10) & "结束:" & Time & Chr(10) & "用时:" & (Time - t) * 86400 & "s" |
|