Hey all!
The Situation:
I am using Excel 2013 (on Windows 10) and I have a simple spreadsheet which lists names and amount payable plus some sundry columns, lets call it the Distribution spreadsheet.
I also have a separate spreadsheet as my Statement template which displays the data from the Distribution spreadsheet.
I have set up the Statement template already through VLOOKUP to automatically insert the client's address, method of payment etc. all based upon the cell containing "Client Name", and that's working basically fine.
The Idea:
I would like the Statement to populate itself based upon the contents of the Distribution spreadsheet.
So basically:
- Distribution spreadsheet has 2 clients on it this time.
- Statement spreadsheet should go to the Distribution spreadsheet and look at cell A2 to get the Client Name, then cells F2, G2 & H2 to gather the various figures, then I2 to get the date.
- Statement spreadsheet should then populate itself with A2 (which inserts the name, address etc. as stated above) as well as F2, G2 & H2 (the figures) and lastly I2.
- Then it saves this with a preset filename which is taken from values in the Statement spreadsheet (see example below)
- Then it repeats this process until it has no more names on the original Distribution spreadsheet.
Summary & Example:
[TABLE="class: grid, width: 600"]
<tbody>[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[/TR]
[TR]
[TD="align: center"]Name[/TD]
[TD="align: center"]Country[/TD]
[TD="align: center"]Native Currency[/TD]
[TD="align: center"]GBP[/TD]
[TD="align: center"]Bank Charge[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"]Retained[/TD]
[TD="align: center"]Payable[/TD]
[TD="align: center"]Date Out[/TD]
[/TR]
[TR]
[TD]Joe Bloggs[/TD]
[TD="align: center"]USA[/TD]
[TD="align: right"]$500[/TD]
[TD="align: right"]£410[/TD]
[TD="align: right"]£10[/TD]
[TD="align: right"]£400[/TD]
[TD="align: right"]£40[/TD]
[TD="align: right"]£360[/TD]
[TD="align: center"]30th January 2017[/TD]
[/TR]
[TR]
[TD]Jimmy Lennon[/TD]
[TD="align: center"]USA[/TD]
[TD="align: right"]$300[/TD]
[TD="align: right"]£205[/TD]
[TD="align: right"]£5[/TD]
[TD="align: right"]£200[/TD]
[TD="align: right"]£20[/TD]
[TD="align: right"]£180[/TD]
[TD="align: center"]30th January 2017[/TD]
[/TR]
</tbody>[/TABLE]
So in this example, two statements should be generated, and they should have the filename of: "2017 1 (30th January) - Joe Bloggs £360.00.pdf" & "2017 1 (30th January) - Jimmy Lennon £180.00.pdf". In code form this would be "{YEAR} {MONTH}({DAY & MONTH}) - {NAME} £{PAYABLE}.pdf".
I can break this problem down into two parts:
1) The statement generation from the source (Distribution) spreadsheet.
2) Saving the Statement as a .pdf with the correct filename for each client.
1) I imagine this will be utilising VLOOKUP a lot to reference the Distribution spreadsheet's contents, presumably based around the Client's Name.
2) I imagine this will have to be done through a Macro assigned to a button on the spreadsheet.
Any help on any parts of the above will be greatly appreciated. I've been tearing my hair out trying to break this down into smaller, manageable parts but can't seem to be able to figure out the logic on this bit.
Thanks everyone!
Your friend,
Joe
The Situation:
I am using Excel 2013 (on Windows 10) and I have a simple spreadsheet which lists names and amount payable plus some sundry columns, lets call it the Distribution spreadsheet.
I also have a separate spreadsheet as my Statement template which displays the data from the Distribution spreadsheet.
I have set up the Statement template already through VLOOKUP to automatically insert the client's address, method of payment etc. all based upon the cell containing "Client Name", and that's working basically fine.
The Idea:
I would like the Statement to populate itself based upon the contents of the Distribution spreadsheet.
So basically:
- Distribution spreadsheet has 2 clients on it this time.
- Statement spreadsheet should go to the Distribution spreadsheet and look at cell A2 to get the Client Name, then cells F2, G2 & H2 to gather the various figures, then I2 to get the date.
- Statement spreadsheet should then populate itself with A2 (which inserts the name, address etc. as stated above) as well as F2, G2 & H2 (the figures) and lastly I2.
- Then it saves this with a preset filename which is taken from values in the Statement spreadsheet (see example below)
- Then it repeats this process until it has no more names on the original Distribution spreadsheet.
Summary & Example:
[TABLE="class: grid, width: 600"]
<tbody>[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[/TR]
[TR]
[TD="align: center"]Name[/TD]
[TD="align: center"]Country[/TD]
[TD="align: center"]Native Currency[/TD]
[TD="align: center"]GBP[/TD]
[TD="align: center"]Bank Charge[/TD]
[TD="align: center"]100%[/TD]
[TD="align: center"]Retained[/TD]
[TD="align: center"]Payable[/TD]
[TD="align: center"]Date Out[/TD]
[/TR]
[TR]
[TD]Joe Bloggs[/TD]
[TD="align: center"]USA[/TD]
[TD="align: right"]$500[/TD]
[TD="align: right"]£410[/TD]
[TD="align: right"]£10[/TD]
[TD="align: right"]£400[/TD]
[TD="align: right"]£40[/TD]
[TD="align: right"]£360[/TD]
[TD="align: center"]30th January 2017[/TD]
[/TR]
[TR]
[TD]Jimmy Lennon[/TD]
[TD="align: center"]USA[/TD]
[TD="align: right"]$300[/TD]
[TD="align: right"]£205[/TD]
[TD="align: right"]£5[/TD]
[TD="align: right"]£200[/TD]
[TD="align: right"]£20[/TD]
[TD="align: right"]£180[/TD]
[TD="align: center"]30th January 2017[/TD]
[/TR]
</tbody>[/TABLE]
So in this example, two statements should be generated, and they should have the filename of: "2017 1 (30th January) - Joe Bloggs £360.00.pdf" & "2017 1 (30th January) - Jimmy Lennon £180.00.pdf". In code form this would be "{YEAR} {MONTH}({DAY & MONTH}) - {NAME} £{PAYABLE}.pdf".
I can break this problem down into two parts:
1) The statement generation from the source (Distribution) spreadsheet.
2) Saving the Statement as a .pdf with the correct filename for each client.
1) I imagine this will be utilising VLOOKUP a lot to reference the Distribution spreadsheet's contents, presumably based around the Client's Name.
2) I imagine this will have to be done through a Macro assigned to a button on the spreadsheet.
Any help on any parts of the above will be greatly appreciated. I've been tearing my hair out trying to break this down into smaller, manageable parts but can't seem to be able to figure out the logic on this bit.
Thanks everyone!
Your friend,
Joe