|
Sub AddSheet()
Dim wb_class As Workbook, sht As Worksheet
Dim i As Integer
i = 2
Set wb_class = Application.Workbooks.Open("E:\1_temp\excel VBA\class.xls") '打开工作簿'
Set sht = wb_class.Worksheets(1) '引用工作表'
Do While sht.Cells(1, "A") <> ""
Worksheets.Add after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = sht.Cells(i, "A").Value
i = i + 1
Loop
End Sub
|
|