|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
各位高手,我再做第4.7.7班级分类时候,用了附件程序,怎么出来的没有标题,而且班级里面除了最后一个其他的都有空格,请大家指教一下,哪里有问题:
Sub fenlei()
Dim i As Integer, sht As Worksheet
Set sht = Worksheets("综合成绩表")
i = 2
Do While sht.Cells(i, "C") <> ""
On Error Resume Next
If Worksheets(sht.Cells(i, "C").Value) Is Nothing Then
Worksheets.Add(after:=Worksheets(Worksheets.Count)).Name = sht.Cells(i, "C").Value
sht.Rows(1).Copy activeWorksheet.Rows(1)
Else
sht.Rows(i).Copy Worksheets(sht.Cells(i, "C").Value).Rows(Range("A1").CurrentRegion.Rows.Count + 1)
End If
i = i + 1
Loop
End Sub
|
|