ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating A Breakout List from a Summary List? (https://www.excelbanter.com/excel-programming/372330-creating-breakout-list-summary-list.html)

cardan

Creating A Breakout List from a Summary List?
 
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 !


Tom Ogilvy

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 !





All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com