Macro to add a number of rows after being prompted

  • Thread starter Thread starter Deb
  • Start date Start date
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.
 
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
 
Back
Top