Link to home
Start Free TrialLog in
Avatar of Bruce Rowse
Bruce Rowse

asked on

excel to word

transfer data from excel to word
Avatar of Karen Falandays
Karen Falandays
Flag of United States of America image

Copy/paste. Tell us more
Hi Bruce,

If you open up Word (I'm using Word 2013), open a new blank document, click on the Insert tab, and then click the dropdown arrow under Table (on the left side of the taskbar). You can then move down to "Excel Spreadsheet" and it will insert an Excel spreadsheet for you on Word, which you can then copy/paste data and formula onto like Karen mentioned, or just create your own new formula. When you double click the table, it'll change the Word taskbar into an Excel taskbar, so it'll be as if you were on Excel.
I thought you mean Mail Merge?

Mail merge using an Excel spreadsheet
https://support.office.com/en-ie/article/mail-merge-using-an-excel-spreadsheet-858c7d7f-5cc0-4ba1-9a7b-0a948fa3d7d3

another way would be create "fields" in your Word document and then update it via VBA.

Sub test()
    Dim objField As Field
    For Each objField In ActiveDocument.Fields
        Select Case objField.Type
        Case 19 'Comments
            Set objRange = objField.Result
            Debug.Print objRange
            
            'To set value
            'objRange.Text = "Your values"
        End Select
    Next
End Sub

Open in new window

Avatar of Bruce Rowse
Bruce Rowse

ASKER

Thanks for the suggestions :)
Specifically I want to build word reports (using a document template) and inserting data (values, text, tables, graphs, photos) from one, possibly 2, different excel document.

The system is to be used for assessments, the excel file will be used to collect data, and then I need to quickly produce a report based on the data in the excel file.

I tried this solution:  https://www.experts-exchange.com/articles/8933/How-to-quickly-and-accurately-populate-Word-documents-with-Excel-data-charts-and-images-including-Automated-Bookmark-generation.html,

It included an excel add-in, but on installation on my Windows10 machine, using Office 2017, the addin failed to run at all (i.e. none of the addin commands appeared). The solution was developed 15 years ago, apparently the author has passed away, perhaps it just won't work now due to developments in Windows and Office. I'm not a programmer and don't want to spend days learning visual basic to code in a solution. This solution is based on the transfer of data in the form of named ranges, which I am familiar with.

I am now considering just marking up my word document with labels for all the fields, and the spreadsheet(s) with labels/named ranges, and contracting someone to do it for me.

Some of the issues are:
- The same field appearing multiple times in the word document (eg "organisation name");
- If a field is blank in the spreadsheet I don't want the word document to just leave the field name and not insert anything, a blank should instead be inserted;
- I need to transfer tables and graphs
- If a graph is missing, I'd like the caption for the graph in the template to be removed to (but I guess I could just include the caption as a field in the excel document....)
- Tables will have a variable number of rows.
- Some of the tables will be wide with many columns. Ideally I don't want the hassle of having blank spaces in front of the numbers transferred, which causes numbers to wrap or take up an extra line in the word table. A common problem when cutting and pasting tables from excel into word (yes, some tables will come across into landscape oriented pages to give extra room, but even then I've had this problem many times).
- I want to be able to transfer photos as well. The excel document would probably just have the file path and image name in it, although the image itself may be inserted into an excel cell.
- Numerical formatting of values transferred needs to be replicated. Eg $20 should be transferred as $20 and not $20.00.
I think it's not easy to address all the issues you have highlighted, some parts look challenging to me.

I would suggest you to breakdown these questions into multiple questions, so you can address them one by one, probably easier for experts to answer too.

just an idea.
Hey Bruce,

I agree with Ryan, a little hard to articulate the numerous requests after the initial one question - I can off the top of my head however answer that last bullet point for you - if you want 20.00 to appear as $20 all throughout the document, you can just Ctrl-A until everything is highlighted, go to the Home tab, and then select the $ sign in the Numbers section of the Home tab.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.