我需要一个简单的Excel,它将使用“第一行”中所有列中的单元格为“提取的数据”表中的每个单元格值创建3个新表,以复制“封面模板”,“数据模板”和“清单模板”工作表。包含数据。
在复制模板工作表之前要复制到每个模板工作表中另一个单元格的单元格值
新的工作表名称为:
在创建新作品并命名后我需要
预先感谢
Sub NewSheets_PFTold()
Dim i As Integer
Dim ws As Worksheet
Dim sh As Worksheet
Set ws = Sheets("DATA")
Set sh = Sheets("EXTRACTED DATA")
Application.ScreenUpdating = 0
Set sh = Sheets("EXTRACTED DATA")
For i = 2 To sh.Range("A1" & Columns.Count).End(xlToLeft).Column
If Worksheets("EXTRACTED DATA").Column(i).ColumnWidth > 0 Then
Worksheets("EXTRACTED DATA").Cells(1, i) = Worksheets("COVER").Cells(e, 3).Value
Worksheets("EXTRACTED DATA").Cells(1, i) = Worksheets("DATA").Cells(b, 3).Value
Worksheets("EXTRACTED DATA").Cells(1, i) = Worksheets("CHECKLIST").Cells(b, 3).Value
Sheets("COVER TEMPLATE").Copy after:=sh
ActiveSheet.Name = sh.Range("1" & i).Value & " COVER "
Sheets("DATA TEMPLATE").Copy after:=sh
ActiveSheet.Name = sh.Range("1" & i).Value & " DATA "
Sheets("CHECKLIST TEMPLATE").Copy after:=sh
ActiveSheet.Name = sh.Range("1" & i).Value & " CHECKLIST "
End If
Next i
End Sub