Macro To Insert Empty Rows??

R

rtidrtid

anyone a dab hand at Excel? I need a had creating a macro. What i hav
is a column with numbers, for example

12222
12222
21111
21111
13333
13333

what i need is a macro which will insert a blank row after an identica
sequence of numbers, turning the above into

12222
12222

21111
21111

13333
13333


any ideas
 
P

Paul B

rtidrtid, here is one way, with data in column A

Sub Insert_Row()
Application.ScreenUpdating = False
Dim Rng As Range
Dim x As Long
Set Rng = Range("A1:A" & Range("A65536").End(xlUp).Row)
For x = Rng.Rows.Count To 2 Step -1
If Rng.Cells(x, 1).Offset(-1, 0).Value <> Rng.Cells(x, 1).Value Then
Rng.Cells(x, 1).Resize(1, 1).EntireRow.Insert Shift:=xlDown
End If
Next x
Application.ScreenUpdating = True
End Sub
 
Top