VBA 根据模板批量生成工作表
生活随笔
收集整理的這篇文章主要介紹了
VBA 根据模板批量生成工作表
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Sub 生成測試()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = FalseDim my_path As Stringmy_path = ThisWorkbook.Path & "\測試結果"Dim i As IntegerFor i = 2 To 101Sheets("cover").Copy after:=Sheets(Sheets.Count)Sheets(Sheets.Count).Range("A17") = Sheets("FunctionList").Range("c" & i).ValueSheets(Sheets.Count).Range("E22") = "【" & Sheets("FunctionList").Range("d" & i).Value & "】"Sheets(Sheets.Count).Range("G39") = Sheets("FunctionList").Range("h" & i).ValueSheets(Sheets.Count).Range("G41") = Sheets("FunctionList").Range("i" & i).ValueSheets(Sheets.Count).Range("A55") = Sheets("FunctionList").Range("a" & i).ValueSheets(Sheets.Count).Range("B55") = Sheets("FunctionList").Range("i" & i).ValueSheets(Sheets.Count).Range("C55") = Sheets("FunctionList").Range("f" & i).ValueSheets(Sheets.Count).Range("I55") = Sheets("FunctionList").Range("h" & i).ValueSheets(Sheets.Count).Range("J55") = "00"Sheets(Sheets.Count).Name = "ユニットテスト仕様書_" & Sheets("FunctionList").Range("c" & i).ValueActiveWorkbook.SaveAs Filename:=my_path & "\" & Sheets(Sheets.Count).Name, FileFormat:=xlWorkbookDefault'ActiveWorkbook.Close TrueNext i
Application.EnableEvents = True
Application.ScreenUpdating = True
Application.DisplayAlerts = TrueEnd Sub
?
總結
以上是生活随笔為你收集整理的VBA 根据模板批量生成工作表的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ABAP 出库单打印 产品 A搭A
- 下一篇: Matlab读取显示图像顺序