![]() |
inserting rows
I need to know if there is a way to insert one row in between each line on a
worksheet without having to click "insert" then "row" everytime? |
inserting rows
Stacie
How many are you looking to insert? If it is just say 20, hold the ctrl key down while selecting every other row and then taking the menu option you outline, it will insert a row at each selection. (Depending on your data you may need to repeat) If it's hundreds we could use code -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England DTHIS www.nickhodge.co.uk "Stacie" wrote in message ... I need to know if there is a way to insert one row in between each line on a worksheet without having to click "insert" then "row" everytime? |
inserting rows
a simple way is to use a helper column.
fill the column column with 1 to n (N = number of rows with data) below this enter =A1+.5 copy down to row 2N selet all and sort by the helper column. delete the helper column "Stacie" wrote: I need to know if there is a way to insert one row in between each line on a worksheet without having to click "insert" then "row" everytime? |
inserting rows
Try:
Sub stacie() Set r = ActiveSheet.UsedRange last = r.Rows.Count + r.Row - 1 For i = last To 1 Step -1 Rows(i).Insert Shift:=xlDown Next End Sub -- Gary''s Student gsnu200707 "Stacie" wrote: I need to know if there is a way to insert one row in between each line on a worksheet without having to click "insert" then "row" everytime? |
All times are GMT +1. The time now is 07:05 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com