Insert Multiple Blank Rows

C

CJ

How do I insert 2 blank rows after each line of data? I have a very large
spreadsheet that I need to format and upload into an accounting application.
The format requires that two blank rows follow each line.

I used the below macro but, it only inserts one row rather then two.

Sub RowInsert()

For X = 2 To 12000
Rows(X).Select
Selection.Insert Shift:=xlDown
X = X + 1
Next X

End Sub
 
T

T Kirtley

CJ,

Try the following modified code:

Sub RowInsert()

For x = 2 To 12000
Rows(x & ":" & x + 1).Select
Selection.Insert Shift:=xlDown
x = x + 2
Next x

End Sub

Hope that helps,

TK
 
C

CJ

Thank you so much, TK. It worked perfectly.

T Kirtley said:
CJ,

Try the following modified code:

Sub RowInsert()

For x = 2 To 12000
Rows(x & ":" & x + 1).Select
Selection.Insert Shift:=xlDown
x = x + 2
Next x

End Sub

Hope that helps,

TK
 
G

Gord Dibben

See a reply at your other post.

Not necessary to use a fixed number of rows...12000.......and those "selects"
just slow down your code.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top