Hello everyone,
Please find attached a workbook with a userform. The purpose of the userform is to capture value automatically based on values from worksheet 'Payment'.
The payment sheet will record every payment made from a corresponding 'Entry Nr'. The 'Payment Nr' of column A is unique and cannot be duplicated but 'Entry Nr' in column B can be duplicated. Duplication occurs, for payment in instalment, for instance or part-payment.
What I would like to achieve is that, based on the corresponding 'Entry Nr', I would like the VBA to extract the first payment date, the last payment date, the amount paid in the last payment and the total amount paid for that 'Entry Nr'. Of course, it is logical to assume that the textboxes for the First and Last Payments Date should be equal if there is only ONE payment made. And equally, the textboxes for Last Paid Amount and Total Paid Amount are also equal since there is only ONE payment and no other subsequent payments were made.
Please see the examples as per the data given.
As you can see from the example of 'Entry Nr 0002' the Last Payment was not recorded as the last in chain since another earlier payment was recorded last.
0002.PNG
0003.PNG
Unfortunately, I could not think of a code to present as I was thinking how should I go about achieving this and never managed to come up with anything meaningful.
Your help and direction is much appreciated.
Thank you very much
Bookmarks