Copying Tables from Word to Excel

aaron12

New Member
Joined
Jul 25, 2019
Messages
1
I have multiple Word documents each which contain multiple tables. I need to extract a certain one of these tables and input it into Word. I have a working VBA code that can accomplish this, however, it has a few limitations. The tables contain a few unique characters (|,°,±, etc) along with some symbols that refer to an installed font. Both Word and Excel have this font, however, when I copy the tables the font does not come over.

Currently I copy the tables by looping through each cell and saving that to an array in VBA then writing that array to cells in Excel interface. I have noticed if I open the Word file manually and Ctrl-C and Ctrl-V the table into Excel the characters will be retained.

Looking for suggestions on how to migrate over those unique characters with either method (using VBA to go cell by cell, or using VBA to save table to clipboard then paste in Excel). Either way, it needs to be automated using VBA because I have thousands of these files to go through.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Cell-by-Cell and character by character you can use AscW to get the wide ascii value for the characters in Word tables and ChrW to put them in Excel.

Posting your existing code may allow a better answer

ChrW Demo:
Code:
Sub Partial_ChrW_List()
    Dim lRow As Long
    For lRow = 1 To 5000  'There are more above this
        Cells(lRow, 1).Value = lRow
        Cells(lRow, 2).Value = ChrW(lRow)
    Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top