new

  • Thread starter Thread starter De
  • Start date Start date
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 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,
 
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.)
 
Showing my ignorance but is this a macro? Because it doesn't look like it
will go on the formula bar.
 
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.
 
Many tks for the help.
--
De


Don Guillett said:
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)
 

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

Similar Threads

Excel Comparing two columns 1
Combining 2 lists 5
Multiple Count Ifs 3
Merging Lines of data 4
how do I sort a column in excel by surname 1
Text to Columns 5
Linked cells between worksheets and sorting 2
How to sort columns? 2

Back
Top