Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default A Macro to Insert Rows

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
  #2   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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert rows with condition using macro Shazza Excel Discussion (Misc queries) 6 September 5th 08 12:06 AM
Insert rows macro. Johnny Excel Discussion (Misc queries) 2 November 13th 07 09:38 PM
Insert Rows Macro A.S. Excel Discussion (Misc queries) 7 October 31st 07 03:03 PM
Excel Macro to insert rows Dhawal Excel Discussion (Misc queries) 3 October 2nd 06 01:16 AM
asking again, macro to insert rows Luke Excel Worksheet Functions 12 September 18th 05 06:32 PM


All times are GMT +1. The time now is 03:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"