Calculating Date Ranges and Weight Totals
It needn't be a complicated macro.
The number of days is found by subtracting C from D
To get subtotals you could look at <Data<Subtotals
Where you can get subtotals per group.
use
at each change in ..........state
use function ..................sum
add subtotal to .............weight
If you do the state subtotals first and then the vendor subtotals AND NOT
thick the option to replace current subtotals.....
You should get what you want.
Greetings from NZ
Bill K
"John Walker" wrote in message
...
Hi,
I need to write a fairly complicated macro and am hopeful that someone may
have had to do something similar and could give me advice.
The spreadsheet itself is simple, with these columns:
STATE, VENDOR, DATE1, DATE2, WEIGHT.
When the macro is run we would like the user to be able to enter a
starting
and ending date. The macro will then go through every row in the
worksheet
and figure out how many days between DATE1 and DATE2 fall within the
user-entered starting/ending date range, and will write the results into
column F for each row.
We also need to group the worksheet by STATE/VENDOR, and give a WEIGHT
total
at each group break.
Is all this possible to do with a macro? If anyone has any sample code
that
would be greatly appreciated.
Thanks in advance,
John
|