Hi, I am trying to loop through the following macro to work through a range of rows.
My goal is to end up with a sheet (Allocation per Employee) populated with the employee department and name and an allocation of time across projects. The Scratch sheet contains a number of formulas that calculate an allocation based on the pasted values from ADP Output.
I am new to macros and not sure how to create a loop to increment the rows/ranges and work through all of the employees. Guidance would be greatly appreciated!
Sub Macro1()
'
' Macro1 Macro
'
'Copy employee department and name from ADP Output and paste to the Allocation Per Employee
Sheets("ADP Output").Select
Range("A5:B5").Select
Selection.Copy
Sheets("Allocation per Employee").Select
Range("A2").Select
ActiveSheet.Paste
'Select time entry data for the employee and copy to the Scratch sheet. The Scratch sheet contains an allocation model to split time across projects.
Sheets("ADP Output").Select
Range("C5:AC5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Scratch").Select
Range("C2").Select
ActiveSheet.Paste
'Capture the allocation output on the Scratch sheet and paste it to the Allocation per Employee sheet
Range("C60:J60").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Allocation per Employee").Select
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
My goal is to end up with a sheet (Allocation per Employee) populated with the employee department and name and an allocation of time across projects. The Scratch sheet contains a number of formulas that calculate an allocation based on the pasted values from ADP Output.
I am new to macros and not sure how to create a loop to increment the rows/ranges and work through all of the employees. Guidance would be greatly appreciated!
Sub Macro1()
'
' Macro1 Macro
'
'Copy employee department and name from ADP Output and paste to the Allocation Per Employee
Sheets("ADP Output").Select
Range("A5:B5").Select
Selection.Copy
Sheets("Allocation per Employee").Select
Range("A2").Select
ActiveSheet.Paste
'Select time entry data for the employee and copy to the Scratch sheet. The Scratch sheet contains an allocation model to split time across projects.
Sheets("ADP Output").Select
Range("C5:AC5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Scratch").Select
Range("C2").Select
ActiveSheet.Paste
'Capture the allocation output on the Scratch sheet and paste it to the Allocation per Employee sheet
Range("C60:J60").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Allocation per Employee").Select
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub