+ Reply to Thread
Results 1 to 9 of 9

Edit Table within Word Document from Excel

  1. #1
    Registered User
    Join Date
    08-23-2014
    Location
    Miami, USA
    MS-Off Ver
    365
    Posts
    69

    Edit Table within Word Document from Excel

    Hi guys,

    I need some help. I'm running some macros from a master workbook and generating a Word document with the data taken from my Excel file.
    This Word document is saved in one of my "D" drive using the values from Cells(2,2) of my master Excel workbook.

    So after my Word document is created and saved, I want to be able to, using VBA, edit a table that is within this Word document that I created (I have attached a sample of the Word document for practical purposes).
    I want to delete all rows of the table where the first column value starts with "[[". The table looks like this:

    Word Table.jpg

    My limited VBA knowledge has taken me to the following code, but this is only the beginning, I don't know where to go from here, any help is appreciated.


    Please Login or Register  to view this content.
    Thank you in advance for any help provided.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Edit Table within Word Document from Excel

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    08-23-2014
    Location
    Miami, USA
    MS-Off Ver
    365
    Posts
    69

    Re: Edit Table within Word Document from Excel

    Perfect AlphaFrog, thank you so much for your help.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Edit Table within Word Document from Excel

    You're welcome. Thanks for the feedback.

  5. #5
    Registered User
    Join Date
    08-23-2014
    Location
    Miami, USA
    MS-Off Ver
    365
    Posts
    69

    Re: Edit Table within Word Document from Excel

    Hello AlphaFrog, I wanted to ask you how would the code look like if I had more than one table in my Word document, and I wanted it to scan all the tables within that Word doc.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Edit Table within Word Document from Excel

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-23-2014
    Location
    Miami, USA
    MS-Off Ver
    365
    Posts
    69

    Re: Edit Table within Word Document from Excel

    Excellent, thank you so much...again

  8. #8
    Registered User
    Join Date
    08-23-2014
    Location
    Miami, USA
    MS-Off Ver
    365
    Posts
    69

    Re: Edit Table within Word Document from Excel

    AlphaFrog would you happen to know why the code gets stuck when the path to the file is too long. I'm guessing that's the reason.
    When I step through the code it gets stuck in this line:
    Please Login or Register  to view this content.
    and then it shows this message:

    2017-01-16_12-02-32.png

  9. #9
    Registered User
    Join Date
    08-23-2014
    Location
    Miami, USA
    MS-Off Ver
    365
    Posts
    69

    Re: Edit Table within Word Document from Excel

    Sorry for all the questions, but It's weird because now it's working. Don't know what changed.

+ 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. open, edit, and save a word document based on user response in excel 2010 VBA
    By cmccabe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2016, 03:13 PM
  2. Is it possible to delete a Table in a Word Document through an Excel VBA Macro?
    By buhnen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2016, 10:44 AM
  3. VBA - Create Word Document or Edit Document if exists
    By unstable81 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-11-2013, 08:27 AM
  4. Locating table # in WORD document with Excel VBA
    By submariner18 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2012, 03:23 AM
  5. [SOLVED] how can I turn a table in Word into an Excel Document?
    By AnnieLondon in forum Excel General
    Replies: 2
    Last Post: 01-17-2006, 01:30 PM
  6. How do I convert a word table into an excel document?
    By Aaron in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-22-2005, 11:10 AM
  7. [SOLVED] excel table in a page of a word document, horizontally
    By AC in forum Excel General
    Replies: 1
    Last Post: 05-16-2005, 05:06 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