views:

95

answers:

1

I'm looking for an Excel 2003 macro to solve this problem.

I have a sheet that holds financial information:

A1 holds client names and AI1,AK1,AM1 etc, hold months April, May, June (all string values) etc; with the rows below that holding the amount due for the corresponding month. The last row is the total.

What I need is to create a summary page that checks a named field called current month which holds the current month as a string value, and the balances for each month up to and including the current month.

If the total due is greater than 0, then place the month name and the total due into a new table on the summary page, so that I end up with a table that has only the months that we have money due to us on it.

A: 

You haven't laid out why you need it to be a macro. But anyway... to make sure I understand the request:

Effectively, create a summary table for each client.

If the sum of dues from January to CurrentMonth > 0 then copy the table.

Delete the column of each month where the amount due is zero.

Okay, since this is Excel 2003, I've been very cautious.

I decided to use a pivot table, then if you want to expand the detail to help identify the clients responsible you can easily do so.

Code

Screencaps at imgur.com: fO7zM.png eCWS2.png 7FBUV.png (I can't post more than one link yet per post)

Little_Kitty
Thanks for your interest - I actually need the projects sheet to remain intact as it has all of the data for the clients. I have created another sheet which is called summary and it only lists the months of the year from april to current month and the total overdue for each month - it has no client data on at all just the total sums that remain due for each month up to cunrrent date. The sum due is in the last row of the projects page and the months header is in Row 1 statring with April going through to March
total newbie
I've updated it with an answer that does this. Getting it to work in 2003 is likely easier than 2007 owing to a bug in 2007 vba treatment of pivot tables... just when I was getting over the ribbon :(
Little_Kitty
This looks awesome thanks - won't be able to test till thursday but reall looking forward to it .....much gratetude for your time and effort- will definately let you know if it works....
total newbie
Cool, I'll check back then. It was interesting to work on as I learnt about a bug in Office 2007... better to learn that now than when the pressure is really on! If you would prefer me to upload an Excel file or email it to you then let me know.
Little_Kitty