Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inserting blank rows in Excell
How do i insert two blank rows after every existing data row in excell
without doing it manually? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inserting blank rows in Excell
Use a macro like the one below
Sub InsertRows() Dim i As Long, nRows As Integer, nEvery As Integer Application.ScreenUpdating = False With ActiveSheet lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row End With nRows = 2 'number of rows to insert For i = lastrow To 1 Step -1 If Not IsEmpty(Cells(i, 1)) Then Rows(i + 1 & ":" & i + nRows).Insert End If Next End Sub "JulieA" wrote: How do i insert two blank rows after every existing data row in excell without doing it manually? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inserting blank rows in Excell
Where would I insert this macro?
"Sheeloo" wrote: Use a macro like the one below Sub InsertRows() Dim i As Long, nRows As Integer, nEvery As Integer Application.ScreenUpdating = False With ActiveSheet lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row End With nRows = 2 'number of rows to insert For i = lastrow To 1 Step -1 If Not IsEmpty(Cells(i, 1)) Then Rows(i + 1 & ":" & i + nRows).Insert End If Next End Sub "JulieA" wrote: How do i insert two blank rows after every existing data row in excell without doing it manually? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Inserting blank rows in Excell
Sheeloo's macros worked perfectly for me using Excel 2007.
Assuming that you are running Excel 2007, follow the steps below. On the Developer tab Click Visual Basic Insert Module Copy Text Below beginning with Sub InsertRows and ending with End Sub. Sub InsertRows() Dim i As Long, nRows As Integer, nEvery As Integer Application.ScreenUpdating = False With ActiveSheet lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row End With nRows = 2 'number of rows to insert For i = lastrow To 1 Step -1 If Not IsEmpty(Cells(i, 1)) Then Rows(i + 1 & ":" & i + nRows).Insert End If Next End Sub File Close and return to Excel Still on the Developer tab Click Macro Highlight InsertRows Run Hope this helps. ~~~~~~~~~~~~~~~~~~~~~~~~~~~ "JulieA" wrote: Where would I insert this macro? "Sheeloo" wrote: Use a macro like the one below Sub InsertRows() Dim i As Long, nRows As Integer, nEvery As Integer Application.ScreenUpdating = False With ActiveSheet lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row End With nRows = 2 'number of rows to insert For i = lastrow To 1 Step -1 If Not IsEmpty(Cells(i, 1)) Then Rows(i + 1 & ":" & i + nRows).Insert End If Next End Sub "JulieA" wrote: How do i insert two blank rows after every existing data row in excell without doing it manually? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting blank rows plus using Sum | New Users to Excel | |||
Inserting Blank rows between items | Excel Discussion (Misc queries) | |||
Inserting blank rows in Excel. | Excel Discussion (Misc queries) | |||
Inserting Blank rows after every row upto 2500 rows | Excel Worksheet Functions | |||
Inserting Blank Rows Macro? | Excel Worksheet Functions |