Creating A Breakout List from a Summary List

C

carlsondaniel

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 !
 
B

Bernie Deitrick

Daniel,

You can use a macro - select a cell in your data table, then try the macro below.

HTH,
Bernie
MS Excel MVP

Sub BreakOutForDaniel()
Dim myCell As Range
Dim myR As Range
Dim i As Integer

Set myR = ActiveCell.CurrentRegion

Cells(myR.Row, myR.Columns(1).Column).Copy _
Cells(Rows.Count, myR.Columns(1).Column).End(xlUp)(3)
Cells(myR.Row, myR.Columns(3).Column).Copy _
Cells(Rows.Count, myR.Columns(2).Column).End(xlUp)(3)

For Each myCell In myR.Columns(2).Offset(1, 0).Cells

If IsNumeric(myCell.Value) Then
For i = 1 To myCell.Value
Cells(myCell.Row, myR.Columns(1).Column).Copy _
Cells(Rows.Count, myR.Columns(1).Column).End(xlUp)(2)
Cells(myCell.Row, myR.Columns(3).Column).Copy _
Cells(Rows.Count, myR.Columns(2).Column).End(xlUp)(2)
Next i
End If
Next myCell

End Sub
 
Top