Sub 取得工作表名()
Dim sh As Worksheet Dim names As Integer Application.ScreenUpdating = False For names = 1 To Sheets.Count Cells(names, 1) = Sheets(names).Name Next names Application.ScreenUpdating = True End Sub 單元格賦值給工作表名稱
Sub aa() Dim arr Dim i% Application.ScreenUpdating = False With Sheets("匯總") arr = .Range("D4:D" & .Cells(Rows.Count, 4).End(3).Row) End With For i = 1 To UBound(arr) Sheets.Add(, Sheets(Sheets.Count)).Name = arr(i, 1) Next i Application.ScreenUpdating = True End Sub |
|