Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Inserting blank rows in Excell

How do i insert two blank rows after every existing data row in excell
without doing it manually?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default 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?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Inserting blank rows in Excell

or. I think I answered this about a week ago.

Sub inserttwoblankrows()
Dim i As Long
Dim mc As String
mc = "a"
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
Rows(i).Resize(2).Insert
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Flintstone" wrote in message
...
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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting blank rows plus using Sum Bill95051 New Users to Excel 3 April 8th 09 07:38 PM
Inserting Blank rows between items JB Excel Discussion (Misc queries) 6 June 5th 08 01:06 PM
Inserting blank rows in Excel. kwm5321 Excel Discussion (Misc queries) 3 December 1st 06 12:19 AM
Inserting Blank rows after every row upto 2500 rows Manju Excel Worksheet Functions 8 August 22nd 06 12:54 PM
Inserting Blank Rows Macro? Michael Saffer Excel Worksheet Functions 2 November 9th 04 06:23 PM


All times are GMT +1. The time now is 05:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"