I have a single workbook with 2 worksheets:
I would like this to be a loop until all data from Extract has been cycled through. Also, I need an adjustment of 1 because I have a header in Azn_TrainA. Lastly, I need to be sure and paste three times the value at the end of the data for each row copied.
For example,
Below is some code that I am starting with...(may not be useful).
I appreciate the help in advance. I am using Excel 2010.
- Azn_TrainA {Has row data A-J which I need to copy and paste at the bottom of Azn_TrainA}
- Extract {Column E has numeric data which states which row I need to copy from Azn_TrainA}
I would like this to be a loop until all data from Extract has been cycled through. Also, I need an adjustment of 1 because I have a header in Azn_TrainA. Lastly, I need to be sure and paste three times the value at the end of the data for each row copied.
For example,
- Extract states to pull row 3
- Row 3 is really on row 4 (due to header row in Azn_TrainA).
Below is some code that I am starting with...(may not be useful).
Code:
Option Explicit
Sub PopulationBuilder()
'
' Objective: to loop through data located within 'Extract' tab and locate, copy, and paste
' data at the bottom of Azn_TrainA 3 times in a row.
'
'Pull value in column E to the end of populated column; value plus 1 equals row to copy for Azn_TrainA
Sheets("Extract").Select
Range("E6").Select
'Sheet with data present from A through J; entire row should be copied and pasted 3 times in a row at the
'end of all the data on sheet.
Sheets("Azn_TrainA").Select
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Selection.End(xlDown).Select
Range("A64414").Select
ActiveSheet.Paste
Sheets("Extract").Select
End Sub
I appreciate the help in advance. I am using Excel 2010.
Last edited: