+ Reply to Thread
Results 1 to 8 of 8

Linking Excel cell to specific section in Word using macro

  1. #1
    Registered User
    Join Date
    07-06-2015
    Location
    Ireland
    MS-Off Ver
    MS Office 2010
    Posts
    5

    Linking Excel cell to specific section in Word using macro

    Hi,

    I've only just joined, but I have been browsing through the site previously and found it very helpful. I'm wondering if anyone on here could help or try steer me in the right direction with an issue.

    I'm looking to link an excel sheet with a word document, the document is a template with certain specific parts that are required to be filled in. Here's a quick example:

    Book 1 contains a certain stress value in cell A1, let's say 0.89

    In the word document, I have a line such as "The maximum stress value is ____"

    I have found different codes online but they only seem to create a new document, while I want to use a spreadsheet to fill in certain parts of an existing word document. I have tried using "Paste Link" but it keeps breaking the links when the two files are moved or copied to a new folder, the link will always try to find the original.

    Can anyone help me on this problem??

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Linking Excel cell to specific section in Word using macro


    Hi,

    you must first create a bookmark in the Word document …

  3. #3
    Registered User
    Join Date
    07-06-2015
    Location
    Ireland
    MS-Off Ver
    MS Office 2010
    Posts
    5
    Quote Originally Posted by Marc L View Post

    Hi,

    you must first create a bookmark in the Word document …
    Once I do that, how can I connect that to a cell on excel? And also keep the link saved if the files get moved from folder to folder

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Linking Excel cell to specific section in Word using macro


    No need to quote the previous message !

    No link if both files are saved in the same path …
    So once workbook is opened, you already know where the word document is stored !
    A workbook macro pilot Word and use the document bookmark to fill data …

    You can also do the opposite : within a Word document macro to pilot Excel …

  5. #5
    Registered User
    Join Date
    07-06-2015
    Location
    Ireland
    MS-Off Ver
    MS Office 2010
    Posts
    5
    Ok thanks, but if I have around 10 bookmarks in my word document. What can I code into excel to fill those bookmarks in? But also allow the two files to change folder path?

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Linking Excel cell to specific section in Word using macro


    See Path property in Excel VBA help !

    One Word bookmark name = one Excel cell name.
    If it's the same names with numbers at end, you even could use a loop …

  7. #7
    Registered User
    Join Date
    07-06-2015
    Location
    Ireland
    MS-Off Ver
    MS Office 2010
    Posts
    5
    Ok I'll look at that,thanks for your help!

  8. #8
    Registered User
    Join Date
    07-06-2015
    Location
    Ireland
    MS-Off Ver
    MS Office 2010
    Posts
    5
    Ok I'll have a look at that, thanks for your help!

+ 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: 07-28-2014, 10:36 AM
  2. Linking specific Excel ranges within a work book into a Word Document
    By singerbatfink in forum Word Formatting & General
    Replies: 2
    Last Post: 01-21-2011, 05:13 AM
  3. Linking an Excel cell to section of a Word Document
    By CharlesEric in forum Excel General
    Replies: 4
    Last Post: 08-14-2009, 02:53 PM
  4. Replies: 0
    Last Post: 04-14-2009, 11:03 AM
  5. [SOLVED] Linking a Specific Word to a Specific Number
    By [email protected] in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-11-2006, 01:45 PM

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