#1   Report Post  
Junior Member
 
Posts: 4
Talking Add a line

I have a voucher I created in an excel spreadsheet (not a form or anything but on the worksheet itself). I need to be able to have the users click on a command button to add a new line. I tried doing it myself but I need the line added in the middle of the document using the same format as the line above. However, when I did it, it would delete the line underneath. How do I have it insert a line in the middle? And is it possible to have them insert more than one line? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 341
Default Add a line

To insert a new line under line 7 with the same formatting as line 7, use
this code

Rows("8:8").Insert Shift:=xlDown

To insert 3 lines, you could do it like this

Rows("8:10").Insert Shift:=xlDown

or you might want to try something like this

For x = 1 to 3
Rows("8:8").Insert Shift:=xlDown
Next x

replacing the 3 with however many lines you want to add.
--
Allllen


"umuckatie" wrote:


I have a voucher I created in an excel spreadsheet (not a form or
anything but on the worksheet itself). I need to be able to have the
users click on a command button to add a new line. I tried doing it
myself but I need the line added in the middle of the document using
the same format as the line above. However, when I did it, it would
delete the line underneath. How do I have it insert a line in the
middle? And is it possible to have them insert more than one line?
Thanks.




--
umuckatie

  #3   Report Post  
Junior Member
 
Posts: 4
Default

Allen-

Thanks it worked great! Only thing it didn't do is copy the merged cells. Is that even possible? Thanks!

Katie





Quote:
Originally Posted by umuckatie
I have a voucher I created in an excel spreadsheet (not a form or anything but on the worksheet itself). I need to be able to have the users click on a command button to add a new line. I tried doing it myself but I need the line added in the middle of the document using the same format as the line above. However, when I did it, it would delete the line underneath. How do I have it insert a line in the middle? And is it possible to have them insert more than one line? Thanks.
  #4   Report Post  
Junior Member
 
Posts: 4
Default

Also, I noticed that when I go to enter the code in another area (there are two different places I need to allow the user to add a line), it changes my previous code. Is there a way to avoid this?
Thanks!

Quote:
Originally Posted by umuckatie
Allen-

Thanks it worked great! Only thing it didn't do is copy the merged cells. Is that even possible? Thanks!

Katie
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
Markers only appearing on comparison line graph [email protected] Charts and Charting in Excel 1 September 1st 06 06:13 PM
Excel chart draws line outside Y axis pc Charts and Charting in Excel 2 July 24th 06 01:36 AM
How do I use a formula to create a new line of text in a cell? Jon Shelton Excel Worksheet Functions 2 July 19th 06 06:00 PM
Data showing incorrectly on line chart gobonniego Charts and Charting in Excel 1 June 15th 06 07:56 PM
Line chart - date line association gone mad! Johannes Czernin Charts and Charting in Excel 5 January 17th 05 08:48 PM


All times are GMT +1. The time now is 09:38 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"