Hi VBA Gurus,
I need some help with a routine to copy specific information from one worksheet to another worksheet in the same workbook.
In the first worksheet, column G contains either a zero or an integer between 1 and twenty five.
I need a routine to go down column G starting at G5 and check the value of the G cell (the first one is G5) if it is zero go to the next cell down in G column. If the G has an integer in it, then copy the corresponding (same row) contents of column A, B and F to the second worksheet in columns A,B& C. Here is the tough part for me. I need it to make as many copies as the value of the integer in column G.
For example:
If the first two rows had a Zero value in column G nothing would get pasted into the second worksheet, but is the third row had a “3” then 3 instances of column A,B, and F from the first worksheet would be copied to the second worksheet to columns A,B and C.
I’m wanting to use a control command button to start the process.
Thanks in advance for any help.

Here is my code

Sub Import_Headers_To_Header_Sheet()

Dim i As Integer
Dim j As Integer
Dim intRowCount As Integer

Application.ScreenUpdating = False
Worksheets("WALL TAKE-OFF").Range("G5").Select
j = ActiveCell.Value
intRowCount = Range("A5").CurrentRegion.Rows.Count - 1
For i = 1 To intRowCount
For Each i In intRowCount
If i>0
Then ActiveCell.Offset(0, -6, 0, -5, 0, -1).Copy
Worksheets("WALL HEADER TAKEOFF").Range("G3").Select
Call ActivateNextBlankDown
'use FillDown method and Offset method to paste items using j value to trigger how ‘many times???
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next i
ActiveCell.Offset(1, 0).Select
Next i
Application.ScreenUpdating = True
End Sub

Private Sub Import_Header_Quan_Location_Click()
Call Import_Headers_To_Header_Sheet
End Sub

Sub ActivateNextBlankDown()
ActiveCell.Offset(1, 0).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
End Sub