PERFICT
IT IS WORKING VERY GOOD
THANKS ASHISH KOUL
From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of ashish koul
Sent: Thursday, February 24, 2011 8:47 AM
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ Insert Row after Change in Value
@omar - try this
Sub InsertRowChange()
Dim i, j, k, z As Long
k = Range("a65356").End(xlUp).Row
Debug.Print k
For i = k To 2 Step -1
If Not IsEmpty(Cells(i, 1)) And Not IsEmpty(Cells(i - 1, 1)) Then
If Cells(i, 1).Text <> Cells(i - 1, 1).Text Then
Range("a" & i).Select
Selection.
This is what I ended up using. Take in mind I was looking in column
B. Work great. Thanks for all your help and suggestions and getting
back so fast.
Sub InsertRowChange()
Dim i, j, k, z As Long
k = Range("b65356").End(xlUp).Row
Debug.Print k
For i = k To 2 Step -1
If Cells(i, 2).T
el-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of ashish koul
Sent: Wednesday, February 23, 2011 6:24 AM
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ Insert Row after Change in Value in a
Selection
try this one
Sub ()
Dim i, j, k, z A
>
> *From:* excel-macros@googlegroups.com [mailto:
> excel-macros@googlegroups.com] *On Behalf Of *ashish koul
> *Sent:* Wednesday, February 23, 2011 6:24 AM
> *To:* excel-macros@googlegroups.com
> *Subject:* Re: $$Excel-Macros$$ Insert Row after Change in Value in a
> Select
Sent: Wed, February 23, 2011 3:21:43 AM
Subject: RE: $$Excel-Macros$$ Insert Row after Change in Value in a Selection
When we run macro again it insert two blank lines
From:excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On
Behalf Of ashish koul
Sent: Wedne
When we run macro again it insert two blank lines
From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of ashish koul
Sent: Wednesday, February 23, 2011 6:24 AM
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ Insert Row after Change in Value
try this one
Sub ()
Dim i, j, k, z As Long
k = Sheets(1).Range("a65356").End(xlUp).Row
For i = k To 2 Step -1
If Sheets(1).Cells(i, 1).Text <> Sheets(1).Cells(i - 1, 1).Text
Then
Range("a" & i).Select
Selection.EntireRow.Insert
End If
Next i
Cells(1, 1).Select
Sub ()
Dim i, j, k, z As Long
z = 1
' change column name here if u want to
x = "a"
Range(x & "65356").Select
Selection.End(xlUp).Select
k = ActiveCell.Row
For i = k To 1 Step -1
If LCase(Range(x & i).Text) <> LCase(Range(x & i - 1).Text) Then
Range(x & i).Select