How do I insert a row between every line in my spreadsheet?

Y

Yonita

I have a spreadsheet that I need to import into MYOB Accounting - for the
import to work there has to be a blank row between each row containing data.

Is there an easy way to insert a blank row between the data?
 
J

Jacob Skaria

With data as below; try the below macro which will insert row in between each
entry..If you are new to macros set the Security level to low/medium in
(Tools|Macro|Security). From workbook launch VBE using short-key Alt+F11.
From menu 'Insert' a module and paste the below code. Save. Get back to
Workbook. Run macro from Tools|Macro|Run <selected macro()>

Col A
1
2
3
4
5

Sub Macro()
Dim lngRow As Long
For lngRow = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
Rows(lngRow).Insert
Next
End Sub


If this post helps click Yes
 
J

Joel

Here is one way without using a macro.

1) In a temporary column Z

Z1 = 1
Z2 = 3

2) Then autofill the column to the end of your data. Lets say the last
autofil number is 1001 at row 500

3) In Stating at the row immediately following you last row of data
Z501 = 2
Z502 = 4

4) Autofill starting at Z503 until you get 1002

5) Now sort on column Z
6) Delete the data fromn column Z.
 

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