Subtotals

H

haas786

Hey all,

I was wondering if i can program something in VBA which would allow me
to do subtotals and then insert lines between the subtotals to allow
the formatting to look good. For example, I have a 10 companies for
which i display subtotals; i have written the VBA code to allow me to
do the subtotals at the press of a button, but to make my report look
presentable, i'd like spaces between the company names/subtotals. Is
there a way to do this easily?

Thanks!
 
J

Joel

If the subtotals were in a unique column or the word subtotal appeared in the
worksheets then you could use code like this

LastRow = Range("A" & Rows.Count).end(xlup).row
For RowCount = LastRow to 1 step -1
if Range("A" & RowCount) = "Subtotal" then
Rows(RowCount + 1).insert
end if
next RowCount
 

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

Top