ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro in excel (https://www.excelbanter.com/excel-programming/439703-macro-excel.html)

Macro To Seperate Unique value[_2_]

macro in excel
 
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 lines, is there a macro to sperate
each unique value?

Per Jessen

macro in excel
 
Hi

Try something like this:


Sub InsertRow()
TargetCol = "A"
FirstRow = 2
LastRow = Range(TargetCol & 1).End(xlDown).Row
For rw = LastRow To FirstRow + 1 Step -1
If Range(TargetCol & rw) < Range(TargetCol & rw - 1) Then
Rows(rw).EntireRow.Insert
End If
Next
End Sub

Regards,
Per

"Macro To Seperate Unique value"
. com skrev i meddelelsen
...
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 lines, is there a macro to
sperate
each unique value?



Gord Dibben

macro in excel
 
See also your post from 4 minutes ago.

Not necessary to multi-post.

Wastes a lot of time and effort.


Gord Dibben MS Excel MVP

On Thu, 18 Feb 2010 11:20:01 -0800, Macro To Seperate Unique value
. 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 lines, is there a macro to sperate
each unique value?




All times are GMT +1. The time now is 03:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com