Macro to add a number of rows after being prompted

D

Deb

I have a spread sheet that is filled in by me before
sending to a customer and will be partially filled in by
customers. Some of the information required by them will
need extra rows. How do I make a macro to add additional
rows below the "original row". (These rows will need to be
inserted between other rows and will be different all the
time.) I would like an input box so they can enter the
number of rows they will need. Any help would be greatly
appreciated. Thank you in advance.
 
M

mudraker

To get the number of rows required use a standard InputBox command an
test if answer is numeric > 0 or false

Dim AddRows
AddRows= InputBox("Insert How Many Rows")
If Not IsNumeric(AddRows) Or AddRows< 1 Then
Exit Sub
End If


How will you determine where the rows are to be added?
set varaible eg

InsertRowAt = 23

Adding x number of rows is easy once you are able to determine wher
they are to go.


Rows(InsertRowAt & ":" & InsertRowAt + AddRows).Inser
Shift:=xlDow
 

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