MegaSack DRAW - This year's winner is user - rgwb
We will be in touch
If i have a very long column of data, each row in that column containing data, is there a way to insert a new row between each row without having to do it manually? The column is over a thousand rows in length.
Thanks
Something along these lines?
Change Range("A1:A100") to suit your data
sub insertrows()
Range("A1:A1000").Select
Dim myrange As Range
Dim NumRows As Integer
dim rowcounter as Integer
Set myrange = ActiveSheet.Range(ActiveWindow.Selection.Address)
NumRows = myrange.Rows.Count
for rowcounter = 2 to (numrows *2) step 2
Rows(rowcounter:rowcounter).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
next rowcounter
end sub
here's a way without using VBA
http://www.pcmag.com/article2/0,2817,1785247,00.asp
using VBA, use the code
Sub insertrow()
Do While Not IsEmpty(ActiveCell)
ActiveCell.EntireRow.Insert
ActiveCell.Offset(2, 0).Select
Loop
End Sub
just tried this, works fine
Sub InsertBlankRow()
For r = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
Rows(r).Insert Shift:=xlDown
Next r
End Sub
Thanks guys - Macro works :)))
