Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Test()
Dim iLastRow As Long Dim iRow As Long Dim i As Long iLastRow = Cells(Rows.Count, "A").End(xlUp).Row iRow = 1 For i = 1 To iLastRow Range("A" & i & ":B" & i).Copy Worksheets("Sheet2") _ .Range("A" & iRow & ":B" & iRow + Range("C" & i).Value - 1) iRow = iRow + Range("C" & i).Value Next i End Sub -- HTH Bob Phillips (remove nothere from email address if mailing direct) "henryl" wrote in message ... I'm trying to create an input file for a mail merge that will create multiple copies of rows based on a cell value. For example my sheet1 has: name address qty henry 123 anystreet 5 I need a sheet2 that contains 5, (the qty), rows of the name and address. Each record may have a different qty. Hope I have explained this well enough. TIA, Henry |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Lookup & return multiple rows based on cell value | Excel Worksheet Functions | |||
why does excel create multiple copies (as many as 18) of a file? | Excel Discussion (Misc queries) | |||
generate multiple rows based on cell value | Excel Worksheet Functions | |||
Create a report with selected rows based on the content in a cell | New Users to Excel | |||
Why does Excel create multiple copies of the same file? | Excel Discussion (Misc queries) |