insert row at each change of surname in excel

D

De

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
 
D

Don Guillett

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
 
C

CLR

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top