![]() |
new
Insert row at each change of surname in column
-- De |
new
Sub insertrowifnamechg()
mc = "a" For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1 If Cells(i - 1, mc) < Cells(i, mc) Then Rows(i).Insert Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "De" wrote in message ... Insert row at each change of surname in column -- De |
new
Subtotal
"De" wrote in message ... Insert row at each change of surname in column -- De |
new
I can't see how I can insert a row using subtotals; the only option seems to
be page break. Is there a way to insert a row? Many thanks, -- De "Stephen" wrote: Subtotal "De" wrote in message ... Insert row at each change of surname in column -- De |
new
I assumed you wanted to do something with the inserted rows, so I was
thinking of Data Subtotals which allows you to specify what you want to do on the inserted rows (sum, average, etc.) "De" wrote in message ... I can't see how I can insert a row using subtotals; the only option seems to be page break. Is there a way to insert a row? Many thanks, -- De "Stephen" wrote: Subtotal "De" wrote in message ... Insert row at each change of surname in column -- De |
new
Showing my ignorance but is this a macro? Because it doesn't look like it
will go on the formula bar. -- De "Don Guillett" wrote: Sub insertrowifnamechg() mc = "a" For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1 If Cells(i - 1, mc) < Cells(i, mc) Then Rows(i).Insert Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "De" wrote in message ... Insert row at each change of surname in column -- De |
new
Many thanks for this but is is a macro? I tried it as both a macro and in
the formula bar but I'm not confident with macros so I might not have got it right. -- De "Don Guillett" wrote: Sub insertrowifnamechg() mc = "a" For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1 If Cells(i - 1, mc) < Cells(i, mc) Then Rows(i).Insert Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "De" wrote in message ... Insert row at each change of surname in column -- De |
new
Many tks for the help.
-- De "Don Guillett" wrote: Sub insertrowifnamechg() mc = "a" For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1 If Cells(i - 1, mc) < Cells(i, mc) Then Rows(i).Insert Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "De" wrote in message ... Insert row at each change of surname in column -- De |
All times are GMT +1. The time now is 12:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com