View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
JB JB is offline
external usenet poster
 
Posts: 115
Default A Macro to Insert Rows

http://cjoint.com/?cesAZcANHi

Sub insertRows()
i = 2
Do While i < [A65000].End(xlUp).Row
Do While Cells(i, 1) = Cells(i + 1, 1)
i = i + 1
Loop
Rows(i + 1).Insert
i = i + 2
Loop
End Sub

JB
http://boisgontierjacques.free.fr

On 2 fév, 17:25, Confused_in_Houston
wrote:
I have repeating data in contiguous cells in a column. *I want to insert a
row into the spreadsheet, each time a value in a cell below is not the same
as the value in the cell immediately above. *This will create groupings of
identical values and a line between the groups.

What I have now:

AAAA
AAAA
AAAA
BBBB
BBBB
CCCC
DDDD

What a want:

AAAA
AAAA
AAAA

BBBB
BBBB

CCCC

DDDD