+ Reply to Thread
Results 1 to 11 of 11

Setting Column Width In Every Excel Table Embeded In Word

  1. #1
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Setting Column Width In Every Excel Table Embeded In Word

    Hi,

    I have several Excel tables in a word document. I want to make Column "B" in every table to have a Width of "25".

    How can I do that through VBA. I can't seem to find how to do it.

    Thanks,

    Mark

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Setting Column Width In Every Excel Table Embeded In Word

    Did you record a macro in Word while adjusting the columns ?



  3. #3
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Re: Setting Column Width In Every Excel Table Embeded In Word

    Quote Originally Posted by snb View Post
    Did you record a macro in Word while adjusting the columns ?
    I had Tried, but it wasn't working for some reason. I couldn't select the tables

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Setting Column Width In Every Excel Table Embeded In Word

    Please post a sample worddocument.

  5. #5
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Re: Setting Column Width In Every Excel Table Embeded In Word

    I tried to upload the file but I am getting an error from ExcelForum.

    Basically, I will have about 200 small Excel tables embedded into the document. When I finished adding the tables, I want to be able to adjust certain properties (column widths, fonts, etc) without opening each one seperately.

    I thought it would be an easy "With" of "For" statement but they are not working.


    Thanks for any help,


    Mark

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Setting Column Width In Every Excel Table Embeded In Word

    An example file containing only 2 exceltables will suffice.
    It's important to identify the method with which the Excel tables have been 'imported' into te document.

  7. #7
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Re: Setting Column Width In Every Excel Table Embeded In Word

    Ok, here it is.

    I place the first one using, Insert>Table>Excel Spreadsheet

    Then I just copied and modified the rest.


    thanks again for your help.

    Mark
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Re: Setting Column Width In Every Excel Table Embeded In Word

    Since no one has an answer for this particular question, does anyone know the easiest want to move all of these tables to a single excel worksheet? Sorry if this question should be in a new thread, if so, I will move it.


    Mark

  9. #9
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Setting Column Width In Every Excel Table Embeded In Word

    I was heading towards a solution:

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Re: Setting Column Width In Every Excel Table Embeded In Word

    thanks, ill look into it further

  11. #11
    Forum Contributor
    Join Date
    12-13-2007
    Location
    Central New York
    MS-Off Ver
    Home: 2007, Office: 2010
    Posts
    158

    Re: Setting Column Width In Every Excel Table Embeded In Word

    I couldn't get it to work. I tried using "shapes" (that is what Excel calls an embedded excel table when recording a macro). But when trying to use "...shapes.count" is comes up with "0".

+ 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