create multiple rows using a variable in a cell as source

G

Guest

Is there a way, to create multiple rows using a variable
in a cell as source to indicate the number replicated
rows needed?

In Excel, I have a name and address and another field to
indicate how many "rows" I need for that record. All the
quantity of replications will be different, that is to
say, I may need one of this one, but 4 of that one, and
10 of yet another. How can I use the quantity variable
to replicate the row in the worksheet?

Ideally, I want to use a source worksheet to create a new
worksheet or better, a workbook, of the replicated rows.
Any resources or ideas would be appreciated.

I am a beginning VB programmer so I am not adverse to
make a stab at coding this if need be, but need some
guidance to get started.

Thanks for any help!

Robert
 
K

Kevin Stecyk

Robert,

Copying from XL 2000 help....

Insert Method Example

This example inserts a new row before row four on Sheet1.

Worksheets("Sheet1").Rows(4).Insert
This example inserts new cells at the range A1:C5 on Sheet1 and shifts cells
downward.

Worksheets("Sheet1").Range("A1:C5").Insert Shift:=xlShiftDown
This example inserts a new row at the active cell. The example must be run
from a worksheet.

ActiveCell.EntireRow.Insert

You could use the Insert method to create the number of blank or available
rows that you want.

You can easily add new worksheets as well.

I think your best bet is to think through carefully on what you are trying
to design, and then start. When you hit speedbumps, ask questions. It is
difficult for us to comment when we don't fully understand or appreciate
what it is your are attempting to accomplish. Don't worry, this happens to
all of us when we begin something new.

I hope this post has given you some food for thought.

Regards,
Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top