Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
ps. I bet that this was a response to an existing post. If I wrote it myself,
I'd qualify the ranges and use "as long" instead of "as integer": Option Explicit Sub InsertRows() Dim numRows As Long Dim r As Long Application.ScreenUpdating = False With ActiveSheet r = .Cells(.Rows.Count, "A").End(xlUp).Row numRows = 3 For r = r To 1 Step -1 .Rows(r + 1).Resize(numRows).Insert Next r End With Application.ScreenUpdating = True End Sub davisk wrote: I found a macro from searhing other postings in "General Questions"; thanks D.Peterson:-) Below is macro previously posted and worked great! I can adjust the amount of inserted rows, which is EXACTLY what I needed. However, just as a precautionary, how do I "un-do" the macro if I make a mistake? Or reverse to delete rows? Thnx, ~k Sub InsertRows() Application.ScreenUpdating = False Dim numRows As Integer Dim r As Long r = Cells(Rows.Count, "A").End(xlUp).Row numRows = 3 For r = r To 1 Step -1 ActiveSheet.Rows(r + 1).Resize(numRows).Insert Next r Application.ScreenUpdating = True End Sub "davisk" wrote: I have one column with data down the first 50 rows. I need to insert 3 new rows for each of the existing rows of data. I failed an attemp using a formula (mod/row) to sort by 1 and then insert. Does anyone know an easier way to insure 3 new rows? Thnx! -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert rows in a worksheet that do not change adjoining rows | Excel Discussion (Misc queries) | |||
How do i insert blank rows between data that is thousands of rows | Excel Discussion (Misc queries) | |||
Insert rows: Formats & formulas extended to additonal rows | Excel Worksheet Functions | |||
How do I insert blank rows between rows in completed worksheet? | Excel Discussion (Misc queries) | |||
How do i insert of spacer rows between rows in large spreadsheets | Excel Discussion (Misc queries) |