VBA help - Autosum/sum by date change

T-rev

New Member
Joined
Aug 19, 2011
Messages
34
please help..

I am trying to auto sum or sum the totals for Hours, QTY and Amount
in the row below the data. i already have the code to insert a new row on date change, my next step is to place "Daily Total" in Range("A") of the inserted Row, and then sum the other columns. The code to get to where i am is below the data table..

A B C D E F
Date Outcome Rate Hours Qty Amount

40771 Activity 20 5.2 104.2


40772 Activity 19 1.5 28.5
40772 Collected 0.5 1 0.5
40772 Collected 0.5 2 1
40772 Collected 0.5 10 5
40772 Activity 19 3.066 58.33
40772 Unavailable 0.18 1 0.18


40773 Activity 19 0.316 6.27
40773 Collected 0.5 2 1
40773 Collected 0.5 2 1
40773 Collected 0.5 8 4
40773 Activity 19 3.116 59.28



Code:
Dim lastRow, chkRw As Integer
    lastRow = Range("A" & Rows.Count).End(xlUp).Row

For chkRw = lastRow To 4 Step -1
    If Range("A" & chkRw) <> Range("A" & chkRw + 1) Then
       Range("A" & chkRw + 1).EntireRow.Insert shift:=xlDown
    End If
     

   Next
 
Last edited:

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
ugh, i cant get the data to copy over properly. does anyone know the method for pasteing screen shots of excel into this forum?
 
Upvote 0
EXCEL JEANIE
Use Excel Jeanie to post up visible (HTML) examples of the data you're referring to, and perhaps a mockup of the desired results you have in mind.
 
Upvote 0
Have you looked at using the DATA > SUBTOTALS function? It would add rows and totals for you all in one swoop.
 
Upvote 0

Forum statistics

Threads
1,224,550
Messages
6,179,462
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top