Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jun 19, 8:33 am, Joel wrote:
Sub addcells() Lastrow = Range("A" & Rows.Count).End(xlUp).Row StartRow = 2 For RowCount = Lastrow To StartRow Step -1 Volumn = Range("D" & RowCount) Rows(RowCount).Copy Rows((RowCount + 1) & ":" & (RowCount + Volumn - 1)).Insert Next RowCount End Sub "Matt.Russett" wrote: Hello, Below is a sample of a 200 row file I am working with. LaneID O Zip D Zip Volume 1 44805 24210 18 2 44805 44309 12 What I need to do is duplicate the rows based on the volume for that lane, so I can load it into an analysis tool we use. The manual process I am currently using is to insert 17 rows after Lane ID 1 and fill down the information so I have a total of 18 rows for that lane. Doing that for over 200 rows is quite tedious! Does anyone have any suggestions as to how I could set up a macro or something so it would automatically look at the Volume column, insert that many rows, and fill the data down? Any suggestions are greatly appreciated! Thanks. I got it to work! Thanks for your help everyone. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
duplicating rows | Excel Discussion (Misc queries) | |||
Formula for Duplicating Rows | Excel Discussion (Misc queries) | |||
Duplicating Rows Based on Cell Value | Excel Discussion (Misc queries) | |||
Duplicating Rows | Excel Programming | |||
Macro to hide rows based on a zero value in a particular cell | Excel Programming |