Excel Multiple Statement Generation from Outside Source Spreadsheet

Pettie

New Member
Joined
Jan 18, 2017
Messages
3
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
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,223,270
Messages
6,171,102
Members
452,379
Latest member
IainTru

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