Sub ShtAdd()
MsgBox "下面将根据C列的班级名新建不同的工作表。"
Dim i As Integer, sht As Worksheet
i = 2 '第一条记录的行号为2
Set sht = Worksheets("成绩表")
Do While sht.Cells(i, "C") <> "" '定义循环条件
For Each na In Worksheets
If na.name = sht.Cells(i, "C") Then
GoTo s
Else
End If
Next
Worksheets.Add after:=Worksheets(Worksheets.Count) '在所有工作表后插入新工作表
ActiveSheet.name = sht.Cells(i, "C").Value '更改工作表的标签名称
s: i = i + 1 '行号增加1
Loop
End Sub