如何获取代码以每次在新表中逐行重复编程的动作

时间:2019-06-25 13:21:22

标签: excel vba repeat

请帮助。

我记录了使用源列表中的数据的代码,将其复制并粘贴到从主表复制的新工作表中。

我希望代码然后执行相同的操作,但是要为下一行数据创建一个新工作表等,同时保持上一个完整,

source list

copied sheet from mastersheet where data should enter

子Macro22() ' 'Macro22宏 '

'

Sheets("Procurement Plan Master").Select
Sheets("Procurement Plan Master").Copy After:=Sheets(5)
Sheets("Procurement Evaluation Tool").Select
Range("C9").Select
ActiveCell.FormulaR1C1 = "Intrusive Fire Damper Survey"
Sheets("Procurement Plan Master (2)").Select
Sheets("Procurement Plan Master (2)").Name = "Intrusive Fire Damper Survey"
Sheets("Procurement Evaluation Tool").Select
Range("A9").Select
Selection.Copy
Sheets("Procurement Evaluation Tool").Select
Range("B9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("M5").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("D9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Procurement Evaluation Tool").Select
Range("E9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("J5").Select
ActiveSheet.Paste Link:=True
Selection.Font.Bold = False
Sheets("Procurement Evaluation Tool").Select
Range("H9").Select
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("Q8").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("I9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("O6").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("J9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("P6").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("L9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("O18").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("M9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("P18").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("N9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("Q6").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("O9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("Q18").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("P9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("P11").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("Q9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("O11").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("S9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("Q11").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("T9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("O23").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("U9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("P23").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select
Range("V9").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Intrusive Fire Damper Survey").Select
Range("Q23").Select
ActiveSheet.Paste Link:=True
Sheets("Procurement Evaluation Tool").Select

结束子

0 个答案:

没有答案