+ Reply to Thread
Results 1 to 7 of 7

Macro to export word table data to excel

  1. #1
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Macro to export word table data to excel

    Hi All,

    I have found a lovely bit of code to export my word table data to an excel spreadsheet. I've modified a bit to suit the job.

    This is to pull all the info off a particular form and place it in my excel spreadsheet, what i need it to do is auto look for the next free row in excel and place the data there, currently I have it written in the code to place the info in row 3 of my excel table, clearly this will be a problem when i run the VB on the next form as it will overwrite my previous data.

    The Word table data selections will not change, and neither will the excel table columns, I just need each form put into the next row of the excel table

    Any help greatly appreciated

    Here is the code I am workin with

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Macro to export word table data to excel

    Since you hard code the Word table row/column, there's no need to iterate the row/columns.

    I think what you want is:
    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Macro to export word table data to excel

    Hi David,

    Sorry about the slow response, this works perfect for me. thanks very much

    You seem to know your stuff so i might ask another question

    In my table in word i have some tick boxes, a yes and no box to be precise, would there be a way to link that to the excel table to return a yes or no?

    That would be very handy but i can work around it if need be,

    Again thanks for your last reply

    Simon

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Macro to export word table data to excel

    Probably. Can you provide a sample sheet and doc?

    Sent from my XT557 using Tapatalk 2

  5. #5
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Macro to export word table data to excel

    I have attached my two documents i am working with, I am still in the early design process but you can see what i am going for, currently the vb you supplied covers up to column H on the excel sheet. I can happily change the form if you see an easier way to work it.

    Really appreciate your help.

    Simon
    Attached Files Attached Files

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Macro to export word table data to excel

    Content controls, ugh!

    Ok, first, it's best if you give a title to all the controls. This only has to be accomplished once.
    Please Login or Register  to view this content.
    Then, use this.
    Please Login or Register  to view this content.
    This will export all the content controls to the spreadsheet.

    (Why did we rename all the controls if you're not going to refer to them by name? This is just in case you want to include/exclude a control, then you can refer to it by name, and not it's number. It's easier on the humans this way. )
    Attached Files Attached Files
    Last edited by Tinbendr; 04-28-2014 at 01:32 PM.

  7. #7
    Forum Contributor
    Join Date
    02-20-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2013
    Posts
    108

    Re: Macro to export word table data to excel

    I have already done much more than I had intended in the beginning, can't thank you enough for your help, I am a novice at VB but learning fast thanks to the forums

    Simon

+ 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: 02-20-2013, 09:57 AM
  2. Export data to the rigth word table
    By Duart in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2012, 12:24 PM
  3. [SOLVED] code to export excel table to word
    By mcope in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2005, 10:05 AM
  4. [SOLVED] export excel data to a word template using a macro
    By Ross1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-25-2005, 01:06 AM
  5. How to export table from Excel to WORD?
    By boroangel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2005, 03:55 AM

Tags for this Thread

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