Formatting rows using SubTotal

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to color the sub-total row and insert a row after the subtotal row.
What vba code locates a sub-total row since the row names change every time
the report is run?
 
If the subtotal row is always the last row, you can capture the last row
with this:

LastRow=cells(rows.count,1),end(xlup).rows (assuming that there is data in
column 1)
cells(Lastrow,1).value = new stuff in column A
cells(Lastrow,2).value = more new stuff in column B

Glen
ps use the Conditional Formatting feature to automaticlly color the SubTotal
row
 
I run sub-total from the Command bar setting the sub-total to break on the
type of account: cash, equity, .... The number of accounts change each
month so a subtotal for one month may be listed on row 10 and for another
month may be listed on row 30.
 

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

Back
Top