Subtotal data of various lengths without entering Sum(...) manuall

J

Jeff-B

I have a large sheet that is broken down by date of sale. I need to subtotal
each days sales. Is there a way to write a vba so that I don't have to
manually type sum(a*.A*) for each and everyday. There number of sales each
day is not constant therefor one cannot just use a constant range length.
 
J

Joel

FirstRow = 3
LastRow = Range("A" & Rows.count).end(xlup).Row

Range("A" & (LastRow + 2).formula = "=Sum(A" & FirstRow & ":A" & LastRow & ")"
 
R

Rick Rothstein \(MVP - VB\)

I'd be surprised if there isn't a worksheet formula solution to your
question. Can you describe to us how your data is laid out?

Rick
 
J

Jeff-B

Thanks for the reply, the data is laid out like this:

Day Sale Commision

01/01/08 1234 100
01/01/08 4321 100
.. . .
.. . .
5555 200 (Last row of the day
is the totals)
01/02/08 1234 100
01/02/08 ect
 

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