View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default insert rows after data change in column

If I understand your request properly, this should do it.

Sub insert6rowsaftersamelastnumber()
Dim i As Long
Dim mc As Long

mc = 1 ' col a
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i - 1, mc) = Cells(i, mc) Then
Rows(i + 1).Resize(6).Insert
Exit For
End If
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"mayer" wrote in message
...
I have a wooksheet with numbers in column a and after the last same number
i
want to insert 6 rows
1
1
1
2
2
3
3
3
4
4
5
5
5
6
6
7
7
8
8
9
9
10
10
11
11
12
12

any help
mayer