insert row at each change of surname in excel

  • Thread starter Thread starter De
  • Start date Start date
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
 
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
 
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
 
Back
Top