inserting a rows

  • Thread starter Thread starter ROLG
  • Start date Start date
R

ROLG

i have a list of about 160 cells in one column-i would like to insert
row after every other row ..between 1&2 between 2& 3 between 3 &
etc...

when i have done that -i have another list of about 160 cells all i
one column that i would like to insert every other one of these into th
inserted rows above.

thankyou so muc
 
Try this ROLG

To insert the rows in "Sheet1" use this

Sub test()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim R As Long
Dim rng As Range
numRows = 1
Set rng = Sheets("Sheet1").UsedRange
For R = rng.Rows.Count To 1 Step -1
rng.Rows(R + 1).Resize(numRows).EntireRow.Insert
Next R
Application.ScreenUpdating = True
End Sub


To copy the cells from "Sheet2" to Sheet1" use this one

Sub test2()
Dim cell As Range
Dim a As Integer
a = 1
For Each cell In Sheets("Sheet1").Columns("A") _
.SpecialCells(xlCellTypeBlanks)
Sheets("Sheet2").Cells(a, 1).Copy cell
a = a + 1
Next cell
End Sub
 
Let's say your first list is in A1:A160 and the 2nd in D1:D160. We will set up
2 helper columns in B and E.

In B1 type the number 1. Then select B1 and Edit/Fill/Series, select Columns,
step value of 1 and stop value 160.

In E1 type the number 1.5, use Edit/Fill/Series as above with stop value 160.5

Edit/Cut the data in D1:E160 and paste it just below the first list, in A161.

Sort the combined list on column B. Then delete column B.
 

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

Back
Top