Macro help

Emmily

Well-known Member
Joined
Oct 5, 2008
Messages
676
Hi i have work task which i'm hoping can be automated. The task is to track clients who are on Payment arrangements according to their payment frequency. Every Tuesday I will manually try and work out which clients i need to chase up for payment based on their frequency. I was hoping there is VBA procedure that can be wrtitten so when i run the code it will filter for those specific clients.

Below is sample data

Excel Workbook
ABCDEFGH
1TitleFirst NameLast NameCompany NameTotalInstalmentPayment Start DateFrequency
2MrJamieSmithTest17,846.64100.0029/04/2009Weekly
3MrChristopherBloggsTest25,830.0050.0006/04/2009Weekly
4MrsBrieMastersTest328,633.44500.0008/09/2010Monthly
5MrsBenBuckinghamTest4800.00200.0022/03/2011Monthly
6MrDamienCotTest54,400.00440.0022/03/2011Monthly
7MrPeterPeshTest617,811.00100.0004/03/2011Weekly
8MrNeilSmithTest71,803.00910.0007/07/2011Quarterly
9MrGrantDenyerTest83,960.00330.0008/03/2011Weekly
10MrStevenGerrardTest98,400.00700.0008/03/2011Monthly
11MrGuySebTest104,020.00100.0022/03/2011Fortnightly
Sheet1
 
I agree with your last payment due date.

My first question is, do you agree with the last payment due date, based on the start date and payment schedule?

If so, we can move to the "what generates an alert" formula.
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
OK, so given the review date and the last payment due date, what should trigger a review, in quantitative terms?

And Emmily with two m's, I'm off to bed with my mate, and will look in on this tomorrow.
 
Upvote 0
Mate, to trigger a review is payment start date or Payment due date and the frequency.

So those clients which are weekly i would want to see True always.

Those which are monthly I would want to see True when the Current date is 7 or even 8 days later from the payment start date, so for 22/03/11 i want to see TRUE on the current Date 29/03/11

Remember a check will always happen the following week from its payment start or due date this procedure is usually with all companies, i have to allow them to make the payment, then a week later the formula will tell me which clients i need to check based on the payment frequencies.


OK, so given the review date and the last payment due date, what should trigger a review, in quantitative terms?

And Emmily with two m's, I'm off to bed with my mate, and will look in on this tomorrow.
 
Upvote 0
If was to continue to perform this task manually then on these current dates i would filter for these clients

Excel Workbook
ABCDEFGHI
3Current Date15-Mar-11
4TitleFirst NameLast NameCompany NameTotalInstalmentPayment Start DateFrequencyCheck
5MrJamieSmithTest17846.6410029-Apr-09WeeklyTRUE
6MrChristopherBloggsTest25830506-Apr-09WeeklyTRUE
7MrsBrieMastersTest328633.445008-Sep-10MonthlyTRUE
8MrPeterPeshTest6178111004-Mar-11WeeklyTRUE
9MrGrantDenyerTest839603308-Mar-11WeeklyTRUE
10MrStevenGerrardTest984007008-Mar-11MonthlyTRUE
11
12Current Date22-Mar-11
13TitleFirst NameLast NameCompany NameTotalInstalmentPayment Start DateFrequencyCheck
14MrJamieSmithTest17846.6410029-Apr-09WeeklyTRUE
15MrChristopherBloggsTest25830506-Apr-09WeeklyTRUE
16MrPeterPeshTest6178111004-Mar-11WeeklyTRUE
17MrGrantDenyerTest839603308-Mar-11WeeklyTRUE
18
19Current Date29-Mar-11
20TitleFirst NameLast NameCompany NameTotalInstalmentPayment Start DateFrequencyCheck
21MrJamieSmithTest17846.6410029-Apr-09WeeklyTRUE
22MrChristopherBloggsTest25830506-Apr-09WeeklyTRUE
23MrsBenBuckinghamTest480020022-Mar-11MonthlyTRUE
24MrDamienCotTest5440044022-Mar-11MonthlyTRUE
25MrPeterPeshTest6178111004-Mar-11WeeklyTRUE
26MrGrantDenyerTest839603308-Mar-11WeeklyTRUE
27MrGuySebTest10402010022-Mar-11FortnightlyTRUE
28
29Current Date12-Apr-11
30TitleFirst NameLast NameCompany NameTotalInstalmentPayment Start DateFrequencyCheck
31MrJamieSmithTest17846.6410029-Apr-09WeeklyTRUE
32MrChristopherBloggsTest25830506-Apr-09WeeklyTRUE
33MrsBrieMastersTest328633.445008-Sep-10MonthlyTRUE
34MrPeterPeshTest6178111004-Mar-11WeeklyTRUE
35MrGrantDenyerTest839603308-Mar-11WeeklyTRUE
36MrStevenGerrardTest984007008-Mar-11MonthlyTRUE
37MrGuySebTest10402010022-Mar-11FortnightlyTRUE
Sheet3
 
Upvote 0
Based on the solution that shg has given you in #25, how do the reults compare if you :-

- Enter the check date as monday, not tuesday.

- use the formula =IF(I4<>"", OR(H4="Weekly",I$2-I4 < 7))

It seems to simple to work, but anything is possible.
 
Upvote 0
Nope that has not worked, i should not be getting TRUE for the below red cells, if the current date is 22/03/11 then i would expect TRUE for the payment dates which have 22/03/11 on 29/03/11, because on 29/03/11 I will be checking if they have payed.

Excel Workbook
ABCDEFGHIJ
2Current Date22/03/2011
3TitleFirst NameLast NameCompany NameTotalInstalmentPayment Start DateFrequencyLast Pmt DueCheck
4MrJamieSmithTest17,846.6410029/04/2009Weekly16-Mar-11TRUE
5MrChristopherBloggsTest25,830.00506/04/2009Weekly21-Mar-11TRUE
6MrsBrieMastersTest328,633.445008/09/2010Monthly8-Mar-11FALSE
7MrsBenBuckinghamTest480020022/03/2011Monthly22-Mar-11TRUE
8MrDamienCotTest54,400.0044022/03/2011Monthly22-Mar-11TRUE
9MrPeterPeshTest617,811.001004/03/2011Weekly18-Mar-11TRUE
10MrNeilSmithTest71,803.009107/07/2011QuarterlyFALSE
11MrGrantDenyerTest83,960.003308/03/2011Weekly22-Mar-11TRUE
12MrStevenGerrardTest98,400.007008/03/2011Monthly8-Mar-11FALSE
13MrGuySebTest104,020.0010022/03/2011Fortnightly22-Mar-11TRUE
Sheet2






Based on the solution that shg has given you in #25, how do the reults compare if you :-

- Enter the check date as monday, not tuesday.

- use the formula =IF(I4<>"", OR(H4="Weekly",I$2-I4 < 7))

It seems to simple to work, but anything is possible.
 
Upvote 0
Based on the solution that shg has given you in #25, how do the reults compare if you :-

- Enter the check date as monday, not tuesday.

- use the formula =IF(I4<>"", OR(H4="Weekly",I$2-I4 < 7))

It seems to simple to work, but anything is possible.


22nd is still tuesday, 21st is monday.
 
Upvote 0
Ok i forgot to change the check date to Mondat, so If the check date is Monday then it works, but then how do i make it work for Tuesday as that is the day i will check for payments

Excel Workbook
ABCDEFGHIJ
2Current Date21/03/2011
3TitleFirst NameLast NameCompany NameTotalInstalmentPayment Start DateFrequencyLast Pmt DueCheck
4MrJamieSmithTest17,846.6410029/04/2009Weekly16-Mar-11TRUE
5MrChristopherBloggsTest25,830.00506/04/2009Weekly21-Mar-11TRUE
6MrsBrieMastersTest328,633.445008/09/2010Monthly8-Mar-11FALSE
7MrsBenBuckinghamTest480020022/03/2011MonthlyFALSE
8MrDamienCotTest54,400.0044022/03/2011MonthlyFALSE
9MrPeterPeshTest617,811.001004/03/2011Weekly18-Mar-11TRUE
10MrNeilSmithTest71,803.009107/07/2011QuarterlyFALSE
11MrGrantDenyerTest83,960.003308/03/2011Weekly15-Mar-11TRUE
12MrStevenGerrardTest98,400.007008/03/2011Monthly8-Mar-11FALSE
13MrGuySebTest104,020.0010022/03/2011FortnightlyFALSE
Sheet2






Based on the solution that shg has given you in #25, how do the reults compare if you :-

- Enter the check date as monday, not tuesday.

- use the formula =IF(I4<>"", OR(H4="Weekly",I$2-I4 < 7))

It seems to simple to work, but anything is possible.
 
Upvote 0
You're checking on Tuesday, but you're checking for payments due on Monday, that's why it works when you change it.

If you desperately need to keep the date as tuesaday then you could edit the "last payment due" formula to

=IF(G4>(I$2-1), "",
CHOOSE(MATCH(H4, {"Weekly","Fortnightly","Monthly","Quarterly"}, 0),
G4 + 7 * INT((I$2 -1 - G4)/7),
G4 + 14 * INT((I$2 - 1 - G4)/14),
EDATE(G4, DATEDIF(G4, I$2 -1, "m")),
EDATE(G4, 3 * INT(DATEDIF(G4, I$2 - 1, "m")/3))
))

But it just seems easier to tweak the date at source.
 
Upvote 0
Jason, for the 29/03/11 i expect the red cells to be TRUE as i would be checking a week later for the payment of 22/03/11.

I am always checking a week later from the payment due date.

Excel Workbook
ABCDEFGHIJ
2Current Date29/03/2011
3TitleFirst NameLast NameCompany NameTotalInstalmentPayment Start DateFrequencyLast Pmt DueCheck
4MrJamieSmithTest17,846.6410029/04/2009Weekly23-Mar-11TRUE
5MrChristopherBloggsTest25,830.00506/04/2009Weekly28-Mar-11TRUE
6MrsBrieMastersTest328,633.445008/09/2010Monthly8-Mar-11FALSE
7MrsBenBuckinghamTest480020022/03/2011Monthly22-Mar-11FALSE
8MrDamienCotTest54,400.0044022/03/2011Monthly22-Mar-11FALSE
9MrPeterPeshTest617,811.001004/03/2011Weekly25-Mar-11TRUE
10MrNeilSmithTest71,803.009107/07/2011Quarterly FALSE
11MrGrantDenyerTest83,960.003308/03/2011Weekly22-Mar-11TRUE
12MrStevenGerrardTest98,400.007008/03/2011Monthly8-Mar-11FALSE
13MrGuySebTest104,020.0010022/03/2011Fortnightly22-Mar-11FALSE
Sheet2
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,722
Members
452,939
Latest member
WCrawford

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