Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to add a number of rows after being prompted

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to add a number of rows after being prompted


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

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default Macro to add a number of rows after being prompted

Hi anonymous poster Deb,
You might also want to take a look at my web page
Insert a Row using a Macro to maintain formulas
http://www.mvps.org/dmcritchie/excel/insrtrow.htm

HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Deb" wrote in message ...
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.



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
INserting Specific Number of Rows via macro [email protected] Links and Linking in Excel 1 November 14th 06 09:56 PM
Macro to Number New Rows Inserted Into Table? Lysander Stark Excel Discussion (Misc queries) 2 August 28th 06 04:49 PM
macro to repeat a formula a set number of rows apart steveo Excel Discussion (Misc queries) 1 July 10th 06 09:21 PM
macro to repeat a formula a set number of rows apart steveo Excel Discussion (Misc queries) 0 July 10th 06 12:46 AM
Save as CSV without being prompted Randall Arnold[_2_] Excel Programming 0 July 17th 03 10:36 PM


All times are GMT +1. The time now is 07:33 PM.

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

About Us

"It's about Microsoft Excel"