From: Macro To Seperate Unique value Macro To Seperate Unique on
how can i create a macro to seperate lines by a uniqe value.e.g if i have
john doe for 10 lines and johnsmith for 20 rows, is there a macro to sperate
each unique value?
From: Gord Dibben on
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
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, 18 Feb 2010 11:16:07 -0800, Macro To Seperate Unique value <Macro To
Seperate Unique value(a)discussions.microsoft.com> wrote:

>how can i create a macro to seperate lines by a uniqe value.e.g if i have
>john doe for 10 lines and johnsmith for 20 rows, is there a macro to sperate
>each unique value?