Word-Excel - including 1-N LINKs based on a cell value

pspinks

New Member
Joined
Jun 1, 2007
Messages
6
I have a Word template (report.dot) which includes links to data stored in several sheets within an Excel file (stored in the same directory).

One of the Excel sheets can contain up to 24 identically formatted blocks of data. Each block appears on a separate A4 page in the Word file, and currently 24 pages are reserved in the report, even though many of them will be blank. Blocks are filled in sequence (1st, 2nd, 3rd, etc) so all the empty blocks (and all the blank pages) will be at the end.

I can calculate (within Excel) how many pages will actually be needed. Is it possible to test this cell and then include exactly the right number of data blocks in the Word report? If yes, can someone show me how?

This is how the Excel data blocks are currently inserted into the report...
Code:
{ LINK Excel.Sheet.8 "{ filename \p }\\..\\Forms.xls" Sheet1!Page01 \p  \* MERGEFORMAT }
{ LINK Excel.Sheet.8 "{ filename \p }\\..\\Forms.xls" Sheet1!Page02 \p  \* MERGEFORMAT }
...
{ LINK Excel.Sheet.8 "{ filename \p }\\..\\Forms.xls" Sheet1!Page24 \p  \* MERGEFORMAT }
Apologies if I have posted in the wrong forum. I read the sticky and this seemed like the right place, but please move it if I'm wrong.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,225,334
Messages
6,184,327
Members
453,227
Latest member
Slainte

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