View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Creating A Breakout List from a Summary List?

Sub ABC()
Dim rng as Range, cell as Range, rw as Long
Dim i as Long
with worksheets("Sheet1")
set rng = .Range(.Cells(2,2),.Cells(rows.count,2).End(xlup))
End with
rw = 1
With worksheets("Sheet2")
for each cell in rng
for i = 1 to cell.value
rw = rw + 1
.cells(rw,1).Value = cell.offset(0,-1).Value
.cells(rw,2).Value = cell.offset(0,1).Value
Next i
Next
.Cells(1,1).Value = "Description"
.Cells(1,2).Value = "Price"
End With
end sub

--
Regards,
Tom Ogilvy


"cardan" wrote in message
ups.com...
I have a summary list that is the first input on a page that I need to
then list out in individual rows. For example:

Turn this..

Description Total Price per Unit
Unit 1 3 $3.00
Unit 2 2 $2.50
Unit 3 2 $1.25

Into this....

Description Price
Unit 1 $3.00
Unit 1 $3.00
Unit 1 $3.00
Unit 2 $2.50
Unit 2 $2.50
Unit 3 $1.25
Unit 3 $1.25

Is it possible to list out from a summary table? If so, can I do it so
there will be no empty rows in the list out since the totals are always
changing? Thank you !