ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Copying & Inserting Rows w/o Affecting other Rows Etc. (https://www.excelbanter.com/excel-worksheet-functions/207273-copying-inserting-rows-w-o-affecting-other-rows-etc.html)

LRay67

Copying & Inserting Rows w/o Affecting other Rows Etc.
 
I have a spreadsheet that a user can click on an option button and copy and
insert rows. Problem is that when this happens it moves all the other data
down another row or two depending on how many times they insert rows.

This affects other macros that have the same capability to copy and insert
rows in other areas of the spreadsheet. I can not figure out how to add
additional rows and maintain the rest of the sheets format throughout the
spreadsheet.

This is the code I have to copy and insert row on one section
Example: User wants another Email Request line they click on the option
button to insert the copied cells.

Sub PIMUserRequest()
'
Range("A16:V16").Select
Selection.Copy
Rows("17:17").Select
Range("C17").Activate
Selection.Insert Shift:=xlDown
Rows("17:17").RowHeight = 15.75
End Sub

Please HELP

Linda

Gord Dibben

Copying & Inserting Rows w/o Affecting other Rows Etc.
 
If you insert a row or rows, the rows below have to go somewhere.

You can insert cells and shift down just for the column without affecting
adjacent columns or rest of row but cells below the inserted cell have to
move down in that column.


Gord Dibben MS Excel MVP

On Tue, 21 Oct 2008 13:50:00 -0700, LRay67
wrote:

I have a spreadsheet that a user can click on an option button and copy and
insert rows. Problem is that when this happens it moves all the other data
down another row or two depending on how many times they insert rows.

This affects other macros that have the same capability to copy and insert
rows in other areas of the spreadsheet. I can not figure out how to add
additional rows and maintain the rest of the sheets format throughout the
spreadsheet.

This is the code I have to copy and insert row on one section
Example: User wants another Email Request line they click on the option
button to insert the copied cells.

Sub PIMUserRequest()
'
Range("A16:V16").Select
Selection.Copy
Rows("17:17").Select
Range("C17").Activate
Selection.Insert Shift:=xlDown
Rows("17:17").RowHeight = 15.75
End Sub

Please HELP

Linda




All times are GMT +1. The time now is 03:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com