PDA

View Full Version : Referencing Multiple Cells



IcePirates
12-17-2008, 07:53 AM
Hello,

This topic is a next-phase of my thread posted here.
http://www.vbaexpress.com/forum/showthread.php?p=169826

The attached script, creates a word document when a command button is clicked, the word document is created, based on information in a specific row on the Excel sheet. (Ie: so if I clicked the command button on line3, the word document would only be built based on information in line3, and so on)

Now within the body of the word document is a file number, which comes from the excel sheet in column "L"..My question is, what if a user needs to select more than one cell in column "L" (for instance what if I need to select, column L, row 3, 4, 5...and I want those all to appear in the body of my word document? How would I make that happen?

I know I have to some-how make it so that a check box automatically appears on every line...but only the selected check boxes get included when the word document is made...

Anyone know how Id make use of something like this?

Let me know!

Thanks!

lucas
12-17-2008, 10:18 AM
Wow, You are writing the entire letter in the code module...

You really should visit the Word forum and link to this. A template would make this much easier to set up and maintain.

I've attached a simple demo of how to use row data to fill bookmarks in a template to print multiple documents to different people. I know it's not what you are doing here but it will give you some real insights into the advantages of using templates and bookmarks to place your data exactly where you want it.

The following thread is a good reference for using bookmarks.

http://www.vbaexpress.com/forum/showthread.php?t=11427