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
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.)
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.
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
(e-mail address removed)
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.