+ Reply to Thread
Results 1 to 2 of 2

How to create word template with data from excel

  1. #1
    Registered User
    Join Date
    01-19-2015
    Location
    Czech
    MS-Off Ver
    MS 2010
    Posts
    1

    How to create word template with data from excel

    Here is situation:
    I have excel table with list of staff (ID, workplace, e-mail, etc.). My idea is, when every employee open word template, he insert his ID and then word automatically filled header of template according to excel table.

    Actually i have no idea how to make it. Is it possible suborn me to start?

    Thank you.

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: How to create word template with data from excel

    You could do that with a macro like the following, stored in the document template's 'ThisDocument' code module:
    Please Login or Register  to view this content.
    The code assumes your IDs are in column A of the Excel workbook and you want to retrieve the corresponding data from columns B to D as well. You can adjust the column references as needed, including adding/deleting columns. The code assumes your document has a dropdown content control (see under Developer>Controls) with the title 'ID' (see under Developer>Controls > (select your content control) >Properties).

    With the above code, you'll need to provide
    • your own workbook path & name for:
    StrWkBkNm = "C:\Users\" & Environ("Username") & "\Documents\Workbook Name.xls"
    • your own worksheet name for:
    StrWkSht = "Sheet1"
    • your own bookmark names for:
    Bookmark1 through Bookmark4

    For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 08-19-2014, 05:13 AM
  2. [SOLVED] Inserting data from table in Word template and create wod/pdf documents
    By SteinerKD in forum Word Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2013, 11:08 AM
  3. Create Word Template from Excel Spreadsheet
    By drosen99 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2012, 12:24 PM
  4. Create a word template including header and footer from excel
    By priyamvada in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2010, 12:51 AM
  5. [SOLVED] Excel data to word template
    By Adam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-14-2005, 01:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1