PDA

View Full Version : Excel Table to Word Table - Please help



jscobie
11-22-2019, 04:00 AM
Hello,

I am a noob to VBA coding but looking for help implementing a macro please.

I would like a straight forward macro for transferring data from a defined cell in excel to a defined cell within a word table in a template. This could be a text replace if necessary.

I just need to make this as straight forward as possible.

Many thanks in advance.

macropod
11-22-2019, 05:14 AM
You need to at least say what application the code is being run from. In any event, what you require can quite possibly be done without code, by linking the two cells together from the Word document.

jscobie
11-22-2019, 06:50 AM
Its MS Excel and MS Word

If the macro could:

1) Open the word document and copy across the relevant data.
2) Create a folder for the file using the file name in a given directory
3) Save the file in the folder
4) Then attach to email

Is that even possible?

macropod
11-22-2019, 01:24 PM
Yes it can be done, but what you're now asking is a far cry from what you originally described.

How about setting out your requirements in full, including:
• which application (Excel, Outlook, Word) the whole process is to be run from;

• where the Excel workbook is to be found;
• where in the Excel the data is sourced;
• where the document template is to be found;
• where in the document template the Excel data are to do;

• what folder the new document is to be saved to;
• how the code is to determine which email to attach the document to;
and so on.

Then, and only then, might someone here be able to help you.