ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Subtotal data of various lengths without entering Sum(...) manuall (https://www.excelbanter.com/excel-programming/415300-subtotal-data-various-lengths-without-entering-sum-manuall.html)

Jeff-B

Subtotal data of various lengths without entering Sum(...) manuall
 
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.

joel

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


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

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

"Jeff-B" wrote:

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.


Rick Rothstein \(MVP - VB\)[_2510_]

Subtotal data of various lengths without entering Sum(...) manuall
 
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


"Jeff-B" wrote in message
...
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.



Jeff-B[_2_]

Subtotal data of various lengths without entering Sum(...) man
 
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


"Rick Rothstein (MVP - VB)" wrote:

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


"Jeff-B" wrote in message
...
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.





All times are GMT +1. The time now is 08:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com