Excel 2010, I have 5 rows of data on one sheet with the first column = part. On the second sheet I have a list of parts - 101, 102, 103.
I need to copy the 5 rows with part = 101, then copy the 5 rows again with part = 102, etc.
Can you state the business case for this requirement?
Maybe an uploaded workbook would help understand what you need and why.
Please answer each of these questions.
Assuming you have headings in row 1 in both tables...
Code:
Dim r As Range, rng As Range, lRow as Long, i As Integer
Set rng = Sheet2.Cells(2, 1)
Set rng = Sheet2.Ranger(rng, rng.End(xlDown))
lRow = 2
For Each r in rng
For i = 1 to 5
Sheet1.Cells(lRow, 1).value = r.value
lRow = lRow + 1
NEXT
Next
Skip, Just traded in my OLD subtlety...
for a NUance!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.