Converting MS-Word Table to Excel

Munich

New Member
Joined
Jul 10, 2006
Messages
31
I have a lot of information (mostly text) that has been provided to me in an MS Word document in a table. When I try to cut and paste it into excel I don't get the desired results (i.e. one table cell from the Word table is one cell in Excel).

I've tried several of the Special Paste options, but nothing is working.

Is there an easy way to get this information converted?

Ernie
(Munich)
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
One Cell for each Table cell is the normal default result of a copy and paste. What are you getting instead?
 
Upvote 0
I don't think that is the default.

I'm getting information in different Excel cells when ever there was a proper paragraph mark in the Word Table cell. Since this is a lot of text information, there are many paragraph marks. So the past from one cell in the MS Word table, in in many cells in Excel.
 
Upvote 0
OK, yes, if you have carriage returns in your Word Table, you will get your text pasted into additional rows for each carriage return in Excel.
Don't know any way to avoid that. Anyone have an answer for that?
 
Upvote 0
BTW, I already tried to replace the Paragraph characters with End Of Line characters, but the results were pretty much the same.
 
Upvote 0
I found this macro on the board some time ago. Sorry, I don't know who to credit for this :oops:

Code:
Sub ImportWordTable()
Dim wdDoc As Object
Dim wdFileName As Variant
Dim TableNo As Integer 'table number in Word
Dim iRow As Long 'row index in Excel
Dim iCol As Integer 'column index in Excel
wdFileName = Application.GetOpenFilename("Word files (*.doc),*.doc", , _
"Browse for file containing table to be imported")
If wdFileName = False Then Exit Sub '(user cancelled import file browser)
Set wdDoc = GetObject(wdFileName) 'open Word file
With wdDoc
TableNo = wdDoc.tables.Count
If TableNo = 0 Then
MsgBox "This document contains no tables", _
vbExclamation, "Import Word Table"
ElseIf TableNo > 1 Then
TableNo = InputBox("This Word document contains " & TableNo & " tables." & vbCrLf & _
"Enter table number of table to import", "Import Word Table", "1")
End If
With .tables(TableNo)
'copy cell contents from Word table cells to Excel cells
For iRow = 1 To .Rows.Count
For iCol = 1 To .Columns.Count
Cells(iRow, iCol) = WorksheetFunction.Clean(.cell(iRow, iCol).Range.Text)
Next iCol
Next iRow
End With
End With
Set wdDoc = Nothing
End Sub
 
Upvote 0
WOW!

And it worked first time. Thanks for having it, and thanks to whom ever created it.

Ernie
 
Upvote 0
I have just 'registered' to MrExcel a few minutes ago and am I glad I did. Thanks - the macro has worked for me. What a time sever.
 
Upvote 0
Hi, Thought I would resurect this as its pretty much what I'm looking to do although maybe a little more blindly.

I have a couple thousand word documents, all formatted in exactly the same way.

I want to convert these to the new format in excel, but I am looking to pull specific table cells from the word documents, to specific cells in excel. There are multiple tables in the word doc, with varying numbers of columns and rows, but the saving grace is that each file is formatted the same way.

Anyone know if this is possible to pin point specific word cells and force into specific excel cells? All the posts I can find seem to want to take the entire tables in one go.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,215,315
Messages
6,124,211
Members
449,148
Latest member
sweetkt327

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