Help!

Insert blank row macro after a break in a group

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions RSS
Next:  Distribution List from Email  
Author Message
Andy
External


Since: Mar 23, 2006
Posts: 253



PostPosted: Thu Nov 05, 2009 10:01 am    Post subject: Insert blank row macro after a break in a group
Archived from groups: microsoft>public>excel>misc (more info?)

I want a blank row inserted in a list after the group breaks. Can anyone
supply me macro code to do this? Thanks.
Back to top
Gord Dibben
External


Since: Feb 23, 2004
Posts: 9178



PostPosted: Thu Nov 05, 2009 1:54 pm    Post subject: Re: Insert blank row macro after a break in a group [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sub InsertRow_At_Change()
'Sandy Mann July 1st, 2007
Dim LastRow As Long
Dim X As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row 'assumes column A
Application.ScreenUpdating = False

For X = LastRow To 3 Step -1
If Cells(X, 1).Value <> Cells(X - 1, 1).Value Then
If Cells(X, 1).Value <> "" Then
If Cells(X - 1, 1).Value <> "" Then
Cells(X, 1).entirerow.Insert Shift:=xlDown
End If
End If
End If
Next X
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 5 Nov 2009 10:01:02 -0800, Andy <Andy.TakeThisOut@discussions.microsoft.com>
wrote:

>I want a blank row inserted in a list after the group breaks. Can anyone
>supply me macro code to do this? Thanks.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum