How to link two Excel sheets in MS Word Mail Merge? - excel

I have two Excel Sheets, Attendance.xlsx & Marks.xlsx, having two different data. And, I have a Word file, in which I am creating a Letter with fixed template using Mail Merge option.
I am not able to link those Excel sheet values into the word file. I can select only one sheet's data at any time.
Kindly let me know how to solve the problem, without copy pasting the data into one sheet.

A mailmerge can only reference one data source at a time. In the case of an Excel workbook, for example, that means a single worksheet. However, a mailmerge main document can contain DATABASE fields and each DATABASE field can reference whatever datasource you want it to. A more detailed outline of the process can be found at: https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_winother-mso_2010/mail-merge-to-a-word-table-on-a-single-page/4edb4654-27e0-47d2-bd5f-8642e46fa103 . For a working demonstration of a mailmerge referencing one worksheet in an Excel data source and a DATABASE field referencing a different worksheet, see: http://www.msofficeforums.com/mail-merge/37844-mail-merge-using-one-excel-file-multiple.html. The same technique can be extended to referencing worksheets in different workbooks.

Related

How to split excel workbook in two workbooks using [office.js] add-in

I am working on one add-in of excel based on office.js in which I have one workbook having multiple worksheets.
As per functionality of add-in, I use format (merge cells size and location) of active sheet, add-in is matching it with every other sheet to find same format.
After checking, the add-in will generate two workbooks, one with same format and other with unmatched format.
I have completed list with sheet name and ismatched, but unfortunately I am not able find any method in which I can move the sheet to the newly created workbook by “createBlankWorkbook” method.
Currently I am thinking to manage this activity by using the add-in two twice, by deleting non-matching sheets and by deleting matching sheets. In this method intensive calculations were performed twice.
Is there any workaround for this problem?

How can I edit the text of Excel table column headers that are the same across all sheets in the workbook?

I have an Excel workbook that has ~100 sheets in it, and each sheet is a table whose headers are exactly the same. I have edited the text of the headers in my blank "to copy" sheet, but I now need to copy those changes across each and every existing sheet (the rest of which have data in them that I cannot lose/change).
I have already tried using Shift+click to select all the sheets, but cannot edit the header because they are already formatted as tables and I get the "Cannot make changes to a table or XML mapping when multiple sheets are selected." error. So I either need a way to select every sheet and make them not a table anymore (temporarily) so that I can make the bulk change, or find some other way of doing this change while they are still a table.
Thanks for your time and advice.
Mirror a single table to multiple sheets in excel using vba
You might see this solution, As it is not possible to change multiple sheets while they are formatted as tables .. you might do the changes if your sheets are not formatted as sml or tables.

Use formula across embedded excel sheets in MS Word (Office 365)

I have an excel sheet embedded in an MS-Word document. At another place in same document I want to put in some outcomes from the embedded spreadsheet (2 cells in particular). The word file needs to be shareable too.
I have tried "linking" excel sheet, but then have to share it (the excel) along with the docx file. Also tried embedding different spreadsheet, but the formulas in the sheets do not talk (or cannot talk to my knowledge)
Is there any way to do this in easy fashion?
What you are asking is not possible. The only workarounds would be to use:
a) an external Excel workbook, with each of your embedded worksheets linked to that; or
b) a macro to activate a given 'source' embedded worksheet in the document, gather the required data from there, then insert that data in the corresponding 'target' worksheet.

VBA to Transfer different fields in excel into one word document without a table

I have an excel spreadsheet where i work out my quotation data. I have been then copying and pasting the different totals for each line of the quote into a Word document. I am trying to get tht code right to transfer each individual field into different parts of the word doc with one click instead of manually copying each one. There are 10 to 20 lines with $amounts that i want to transfer to my word template
In Excel I have
Qty 50
Components 40
Hardware 130
Panel 375
NRE 850
Then in Word I have
Qty
PCB Cost
Components
Hardware
Panel
NRE
USD Exchange
Total
How can i get the numbers from excel into the correct lines in word?
The trick is to set bookmarks in the word document at the locations where you want to data to appear. So to transfer the quantity place a bookmark called "quantity" just to the right of the text "Qty". You can then use Bookmarks("quantity") to refer to that location. You haven't said whether you want to run your code in Word and fetch the excel data, or run it in Excel and push it to Word - but the principle is the same. Set a reference in the code running app to the other, declare a variable to point to the other app, launch it, open the source or receiving file, declare the source range as an excel range object (lets say we call it rSource) and declare a word range object (lets call it myqty) to point to Bookmarks("quantity").range
you can then say
myqty = rSource.text
If it's always the same workbook & range of cells, you can link the document or its template to the workbook so there is nothing to copy/paste each time. To set up such a link, copy a given Excel range, then paste it into your document or template using Paste Special, with the 'paste link' option and your preferred paste format. That way the document - or a new document created from the template - will automatically reflect the Excel data. If you're using a template, you might then break the links (e.g. via Ctrl-A, Ctrl-Shift-F9) so the new documents don't keep updating when you re-open them.

Treat .mdb as .xlsx?

I recently made an Excel workbook (with the help of Stackoverflow) where I have a regular input of data (each entry is one row with different columns). I then have a macro that extracts the data from a specified row to a different sheet and saves this sheet as a .PDF.
That way, I can extract specific data from this Excel "database" to a readable pdf. I do this because I need a paper version from specific entries.
For a different project I need to implement the same principle. The only difference is that I need to work with an .mdb file where the data is stored, instead of an Excel workbook.
Is there a way I can reuse my code from Excel or is it now a completely different story?
Thank you for the advice.
You can link your excel workbook to your Access tables. On the "DATA" ribbon there is a section for "External Data".
Once you've got the Access data displayed on one of your worksheets, you should be able to adapt your existing code accordingly.
From Microsoft:
Connect an Access database to your workbook

Resources