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
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: