Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting Variable Number of Rows
I'm trying to create a chunk of code that copies an entire row and then inserts a variable amount. here is the code insertrows = 3 + prodlength Rows("3:3").Select Selection.Copy Rows("4:insertows").Select Selection.Insert Shift:=xlDown Is it possible to do something like this? I'm trying to do this method because it copying and inserting rows preserves all the formatting. The variable prodlenght is the number of products found off another worksheet in the workbook. -- bundyloco ------------------------------------------------------------------------ bundyloco's Profile: http://www.excelforum.com/member.php...o&userid=23386 View this thread: http://www.excelforum.com/showthread...hreadid=399996 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting Variable Number of Rows
Would you consider replacing
Rows("4:insertows").Select Selection.Insert Shift:=xlDown with Rows("4:insertows").entirerow.insert "bundyloco" wrote: I'm trying to create a chunk of code that copies an entire row and then inserts a variable amount. here is the code insertrows = 3 + prodlength Rows("3:3").Select Selection.Copy Rows("4:insertows").Select Selection.Insert Shift:=xlDown Is it possible to do something like this? I'm trying to do this method because it copying and inserting rows preserves all the formatting. The variable prodlenght is the number of products found off another worksheet in the workbook. -- bundyloco ------------------------------------------------------------------------ bundyloco's Profile: http://www.excelforum.com/member.php...o&userid=23386 View this thread: http://www.excelforum.com/showthread...hreadid=399996 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting Variable Number of Rows
insertrows = 3 + prodlength
Rows("3:3").Copy Rows("4:" & insertrows).Insert -- HTH RP (remove nothere from the email address if mailing direct) "bundyloco" wrote in message ... I'm trying to create a chunk of code that copies an entire row and then inserts a variable amount. here is the code insertrows = 3 + prodlength Rows("3:3").Select Selection.Copy Rows("4:insertows").Select Selection.Insert Shift:=xlDown Is it possible to do something like this? I'm trying to do this method because it copying and inserting rows preserves all the formatting. The variable prodlenght is the number of products found off another worksheet in the workbook. -- bundyloco ------------------------------------------------------------------------ bundyloco's Profile: http://www.excelforum.com/member.php...o&userid=23386 View this thread: http://www.excelforum.com/showthread...hreadid=399996 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Linking to a Variable Number of Rows - XP/07 | Excel Worksheet Functions | |||
INserting Specific Number of Rows via macro | Links and Linking in Excel | |||
Same operations on a variable number of rows | Excel Programming | |||
Inserting a variable number of rows in a worksheet | Excel Programming | |||
deleting variable number of rows | Excel Programming |