Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Duplicate Rows Based On Cell Value?

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
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!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Duplicate Rows Based On Cell Value?

Great!

Thank You, Bob!

This piece made my life much easier!

RV
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically Duplicate Rows based on Volume. Matt.Russett Excel Worksheet Functions 0 June 18th 08 09:22 PM
Convert Columns to Rows based upon a duplicate value EJR Excel Programming 3 December 31st 07 07:54 PM
Duplicate rows, based on date difference Ixtreme Excel Programming 7 August 11th 07 01:41 PM
Duplicate rows based on date difference Ixtreme Excel Programming 1 August 11th 07 11:44 AM
Delete duplicate rows based on part of cell. okrob Excel Programming 0 February 14th 07 07:25 PM


All times are GMT +1. The time now is 12:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"