|
小改一下。。。
- Sub 新建簿及增表2() '//2024.8.24
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- Set wb = Workbooks.Add
- n = Val(InputBox("请输入3的整除数", "", 1))
- If n = 0 Then Exit Sub
- ReDim ar(1 To n * 9)
- br = Array("", "A", "B")
- For i = 0 To UBound(br)
- For j = 1 To n * 3
- With wb.Worksheets.Add(after:=wb.Worksheets(wb.Worksheets.Count))
- .Name = j & br(i)
- End With
- Next j
- Next i
- wb.SaveAs Filename:="d:\库存.xls", FileFormat:=56
- wb.Close
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|