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/autosum the other columns with values.
Data example is as follows
A B C D E F G
Date Campaign Outcome Rate Hours QTY Amount
22/09/2011, #####, Activity, 20.00, 5 , , 100.00
22/09/2011, #####, Collection, 0.50, , 1, 0.50
23/09/2011, #####, Activity, 19.00, 1 , , 19.00
24/09/2011, #####, Activity, 20.00, 2 , 40.00
24/09/2011, #####, Collection, 0.50, , 2, 1.00
24/09/2011, #####, Collection2, 1.00, , 4, 4.00
appologies for the spacing of the data, unsure how to post data correctly.. as paste doesnt seem to work.. i have seperated columns using comma's if it helps.
The code i have so far...
Any help would be greatly appreciatedDim 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 by T-rev; 09-22-2011 at 02:00 AM.
To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.
If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.
Doing this will ensure you get the result you need!
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
sure, sorry i didnt know how to add a workbook, now i see..
please note that the data does change, every new sheet imported may have different numbers of rows for different dates, (more Entries of "Activity" or "Collected")
have attached dummy workbooks for you.....
Forum example Before.xlsm
Forum example After.xlsm
Last edited by T-rev; 09-22-2011 at 08:49 AM.
If you removed the completely empty rows in your data then you could use a PivotTable
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
would rather not, the idea is the data is imported from another program (which exports to excel) but is completely locked for editing.. so the macro is to copy the data to a new worksheet which it does, and then format it accordingly so the raw data can be used for another spreadsheet later in the process..
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks