+ Reply to Thread
Results 1 to 10 of 10

VBA Code to copy table from word into excel

  1. #1
    Registered User
    Join Date
    09-17-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    VBA Code to copy table from word into excel

    I am looking for VBA script that copies the second table (two columns 19 rows) in a word document into ‘Book 3’ excel spread sheet in a specified location keeping the source formatting.

    Any help would be much appreciated.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA Code to copy table from word into excel

    try this
    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    09-17-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA Code to copy table from word into excel

    Hi...thanks for the code it is the best that I have seen.....is there any chance that the code can be tweaked so that the extracted information loads from where you have clicked in an excel file and can it also incorporate the assumption that the extracted information is from the active word document?

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA Code to copy table from word into excel

    I'm sorry, I found it and never used

  5. #5
    Registered User
    Join Date
    09-17-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA Code to copy table from word into excel

    Hi..I have tested the above code and it works but I would would like it to pull the data from the active word document.....does anyone have any idea how to do this?

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA Code to copy table from word into excel

    When you are using Excel you have no active word document, you have only a open word document, then you have to know the file name
    Please Login or Register  to view this content.
    Last edited by patel45; 12-14-2012 at 07:39 AM.

  7. #7
    Registered User
    Join Date
    09-17-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA Code to copy table from word into excel

    Hi...with the scenario that I will be working with there will be a word document opened....(opened from an e-mail attachment) and excel will be open therefore I need it to recognise the word document that is open...if that makes sense.

    Kind Regards



    Sharon

  8. #8
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: VBA Code to copy table from word into excel

    It's better you open a new thread with title How to recognise the word document that is open

  9. #9
    Registered User
    Join Date
    04-02-2013
    Location
    Atlanta, GA USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: VBA Code to copy table from word into excel

    This does work very well - much appreciated for the tips. But I have a situation where I have multi-row merged cells. For example, in the first table column, there would be a merged cell for rows 2-4, but the 2nd and subsequent columns would be unmerged. Is there a way to unmerge these cells prior to pulling them into Excel? Thanks in advance!

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA Code to copy table from word into excel

    jcorriher,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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