ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   insert row at each change of surname in excel (https://www.excelbanter.com/new-users-excel/175934-insert-row-each-change-surname-excel.html)

De

insert row at each change of surname in excel
 
I have a list of 650 entries using 40 surnames - sometimes only appearing
once, others 7 times. At every change in surname, I would need to insert a
row. Thanks
--
De

Don Guillett

insert row at each change of surname in excel
 

something like this
sub insertrows()
for i=cells(rows.count,"a").end(xlup).row to 2 step -1
if cells(i-1,"a")<cells(i,"a") then rows(i).insert
next i
end sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"De" wrote in message
...
I have a list of 650 entries using 40 surnames - sometimes only appearing
once, others 7 times. At every change in surname, I would need to insert
a
row. Thanks
--
De



CLR

insert row at each change of surname in excel
 
Why do you want to do this? It will mess things up for sorting if you should
ever want to do that. Maybe just consider making the rowheight larger, if
it's just for display purposes......that will still sort, and is easily
correctable.


Vaya con Dios,
Chuck, CABGx3



"De" wrote:

I have a list of 650 entries using 40 surnames - sometimes only appearing
once, others 7 times. At every change in surname, I would need to insert a
row. Thanks
--
De


De

insert row at each change of surname in excel
 
The formula has really helped. Many thanks,
De


"De" wrote:

I have a list of 650 entries using 40 surnames - sometimes only appearing
once, others 7 times. At every change in surname, I would need to insert a
row. Thanks
--
De



All times are GMT +1. The time now is 08:25 AM.

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