+ Reply to Thread
Results 1 to 5 of 5

Word table into excel cells

  1. #1
    Registered User
    Join Date
    05-18-2010
    Location
    Los Angeles, US
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question Word table into excel cells

    I have a collaboration of word documents that are in tables and I just want to get them in excel. So that each word table cell (no matter what is in it numbers, bullets, etc..) is copied to one excel cell. I know the formatting will go crazy and that is ok... I just don't want every sentence, numbered item, bullet, to be treated in excel as another cell.

    For example

    Word Table

    _______
    Types of cars:
    Ford
    Honda
    Toyota
    ________

    **
    When I try to import this into excel it comes out like this:
    **

    Excel WRKB

    ________
    Types of cars:
    ________
    Ford
    ________
    Honda
    ________
    Toyota
    ________

    *
    It combines all of the information into 4 cells rather than just one. Any help would be greatly appreciated.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,977

    Re: Word table into excel cells

    I hate to post "I dunno" posts but in this case I'll tell you I've wrestled with the same issue for years without an elegant solution.

    When Word copies paragraph breaks and manual line breaks to the clipboard, Excel interprets them as cell delineations, in addition to the actual table cells.

    The only approach I can think of, but have never actually implemented, is to write VBA that converts the breaks to some other character first, copies the table, then converts them back to line breaks (Excel and Word use different characters for line breaks). The character code for an Excel line break is 10.

    If I find myself with time on my hands in the next day or two I'll see if I can whip something up. It never seemed worth it just for me but if I can help someone else too it might pay off.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,977

    Re: Word table into excel cells

    I wrote some code to take the characters out of the clipboard that seem to be causing the problem but I haven't been able to complete a test because I get this error on the last line:

    Automation Error: CloseClipboard Failed

    I have been unable to find any documentation about what this actually means or what to do about it.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-10-2012
    Location
    Huntsville, AL
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Word table into excel cells

    Here's an Excel Macro that will Paste whatever is Copied, (Go to Word, Select your Table and Right-Click on the X on the Top Left of the Table, and Select Copy from the Drop Down Menu, Alternately, press the Ctrl-C Combination to Copy). Then go to Excel and run this Macro.

    Please Login or Register  to view this content.
    'Bonus, (Clear ScratchPad just brings up a Blank WorkSheet ~ You could Omit it if you already have a SpreadSheet open.

    'I think you'll like the "Clear_ScratchPad" Macro, so I'm Including it below ~ You Will need to Create a SpreadSheet Called ScratchPad.xlsm located at "C:\Users\Public\Documents\Excel Documents\ScratchPad.xlsm".

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Last edited by arlu1201; 11-11-2012 at 06:09 AM. Reason: Code tags.

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

    Re: Word table into excel cells

    Jolly_Chollie,

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature below this post.
    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