View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Duplicate Rows Based On Cell Value?

Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim LastRow As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = LastRow To 2 Step -1

If .Cells(i, "B").Value 1 Then

.Rows(i + 1).Resize(.Cells(i, "B").Value - 1).Insert
.Rows(i).Copy .Cells(i + 1, "A").Resize(.Cells(i,
"B").Value - 1)
End If
Next i

End With

End Sub

--
__________________________________
HTH

Bob

wrote in message
...
Hi,

I´m lookig for:
Pos. Qty W H
1 2 316 910
2 4 399 1180
3 1 784 1180

to become:
Pos. Qty W H
1 2 316 910
1 2 316 910
2 4 399 1180
2 4 399 1180
2 4 399 1180
2 4 399 1180
3 1 784 1180

Thanks!