I am trying to create multiple workbooks by replacing 5 cells of data (from another workbook) to reflect a new employee's information and save under that person's name. I am a bit out of my league here. I recorded a macro by copying/pasting data from the source workbook that is storing the person's information to the workbook I want to update and save. But I have no idea how to change the code to automate this so a new workbook is updated with those 5 lines and then saved under a new name from each row of the source file. Here is what the recorded macro looks like:
Sub IMPS()
'
' IMPS Macro
'
' Keyboard Shortcut: Ctrl+Shift+X
'
Selection.Copy
Windows("2017 YTD Template CASH V2.xlsm").Activate
Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("FTE - IMPS.xlsx").Activate
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Windows("2017 YTD Template CASH V2.xlsm").Activate
Range("B5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("FTE - IMPS.xlsx").Activate
Range("C2").Select
Application.CutCopyMode = False
Selection.Copy
Windows("2017 YTD Template CASH V2.xlsm").Activate
Range("B6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("FTE - IMPS.xlsx").Activate
Range("D2").Select
Application.CutCopyMode = False
Selection.Copy
Windows("2017 YTD Template CASH V2.xlsm").Activate
Range("B7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("FTE - IMPS.xlsx").Activate
Range("E2").Select
Application.CutCopyMode = False
Selection.Copy
Windows("2017 YTD Template CASH V2.xlsm").Activate
Range("B8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents\Scorecards\2017 YTD Scorecard.xlsm" _
, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Windows("FTE - IMPS.xlsx").Activate
End Sub
Can anyone help me edit this so it will create a new workbook for every employee in my source file? Thank you!!
Sub IMPS()
'
' IMPS Macro
'
' Keyboard Shortcut: Ctrl+Shift+X
'
Selection.Copy
Windows("2017 YTD Template CASH V2.xlsm").Activate
Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("FTE - IMPS.xlsx").Activate
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Windows("2017 YTD Template CASH V2.xlsm").Activate
Range("B5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("FTE - IMPS.xlsx").Activate
Range("C2").Select
Application.CutCopyMode = False
Selection.Copy
Windows("2017 YTD Template CASH V2.xlsm").Activate
Range("B6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("FTE - IMPS.xlsx").Activate
Range("D2").Select
Application.CutCopyMode = False
Selection.Copy
Windows("2017 YTD Template CASH V2.xlsm").Activate
Range("B7").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("FTE - IMPS.xlsx").Activate
Range("E2").Select
Application.CutCopyMode = False
Selection.Copy
Windows("2017 YTD Template CASH V2.xlsm").Activate
Range("B8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents\Scorecards\2017 YTD Scorecard.xlsm" _
, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
Windows("FTE - IMPS.xlsx").Activate
End Sub
Can anyone help me edit this so it will create a new workbook for every employee in my source file? Thank you!!