ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Importing Word tables into Excel (https://www.excelbanter.com/excel-programming/416034-importing-word-tables-into-excel.html)

Bonsai Bill

Importing Word tables into Excel
 
I need to import a Word table, and its continuation, into Excel. The table is
tab delimited so cutting and pasting would be fine. I can clean it up
afterwards before using the data. In trying to impliment past postings on
this site I found that the table has vertically merged cells (generates error
5991). The other problem is that it is called "Table 6" but there are many
unnumbered tables in the document preceding it.

I can find tables because they have unique text in headings (e.g. Seq.).
Picking up proper code using the Word macro recorder to find table and then
put selected tables onto clipboard didn't work.

Could someone please provide me with sample code to find the tables, put
them onto the clipboard and paste them into Excel? I am using OfficeXP but
users may have later editions, including Office 2007.

All suggestions would be greatly appreciated!

JLGWhiz

Importing Word tables into Excel
 
See if this site provides any answers.

http://wagda.lib.washington.edu/gish...ial/excel.html

"Bonsai Bill" wrote:

I need to import a Word table, and its continuation, into Excel. The table is
tab delimited so cutting and pasting would be fine. I can clean it up
afterwards before using the data. In trying to impliment past postings on
this site I found that the table has vertically merged cells (generates error
5991). The other problem is that it is called "Table 6" but there are many
unnumbered tables in the document preceding it.

I can find tables because they have unique text in headings (e.g. Seq.).
Picking up proper code using the Word macro recorder to find table and then
put selected tables onto clipboard didn't work.

Could someone please provide me with sample code to find the tables, put
them onto the clipboard and paste them into Excel? I am using OfficeXP but
users may have later editions, including Office 2007.

All suggestions would be greatly appreciated!


Bonsai Bill

Importing Word tables into Excel
 
Thanks for your input. The site gives a manual way to import files.

I was not completely clear in my original statement. I need to import the
Word data onto a scratch sheet then extract only the columns of data needed
and put those onto another sheet and make calculations, all using VBA. I
would like to set it up so that user is requested to give only the path to
Word file (which I can do) and then see final results. My problem is that I
don't know enough Word VBA coding to
1) use find command to get to the table
2) select the table contents
3) place selected data on clipboard (although I found how to do that from
Help I think)
4) place contents on scratch sheet (I assume that paste can be used but are
there possible problems with that?)

Example code for doing these steps would be greatly appriciated.

"JLGWhiz" wrote:

See if this site provides any answers.

http://wagda.lib.washington.edu/gish...ial/excel.html

"Bonsai Bill" wrote:

I need to import a Word table, and its continuation, into Excel. The table is
tab delimited so cutting and pasting would be fine. I can clean it up
afterwards before using the data. In trying to impliment past postings on
this site I found that the table has vertically merged cells (generates error
5991). The other problem is that it is called "Table 6" but there are many
unnumbered tables in the document preceding it.

I can find tables because they have unique text in headings (e.g. Seq.).
Picking up proper code using the Word macro recorder to find table and then
put selected tables onto clipboard didn't work.

Could someone please provide me with sample code to find the tables, put
them onto the clipboard and paste them into Excel? I am using OfficeXP but
users may have later editions, including Office 2007.

All suggestions would be greatly appreciated!


JLGWhiz

Importing Word tables into Excel
 
Here is another site that deals with VBA. You seem to be aware that this is
not a single step process. I doubt that any of the responders in this forum
would try to lay out the process in a single posting. Perhaps after
reviewing the link below you can take one bite of the elephant at a time
until you eat the whole thing.

http://www.dailydoseofexcel.com/arch...t-text-in-vba/

"Bonsai Bill" wrote:

Thanks for your input. The site gives a manual way to import files.

I was not completely clear in my original statement. I need to import the
Word data onto a scratch sheet then extract only the columns of data needed
and put those onto another sheet and make calculations, all using VBA. I
would like to set it up so that user is requested to give only the path to
Word file (which I can do) and then see final results. My problem is that I
don't know enough Word VBA coding to
1) use find command to get to the table
2) select the table contents
3) place selected data on clipboard (although I found how to do that from
Help I think)
4) place contents on scratch sheet (I assume that paste can be used but are
there possible problems with that?)

Example code for doing these steps would be greatly appriciated.

"JLGWhiz" wrote:

See if this site provides any answers.

http://wagda.lib.washington.edu/gish...ial/excel.html

"Bonsai Bill" wrote:

I need to import a Word table, and its continuation, into Excel. The table is
tab delimited so cutting and pasting would be fine. I can clean it up
afterwards before using the data. In trying to impliment past postings on
this site I found that the table has vertically merged cells (generates error
5991). The other problem is that it is called "Table 6" but there are many
unnumbered tables in the document preceding it.

I can find tables because they have unique text in headings (e.g. Seq.).
Picking up proper code using the Word macro recorder to find table and then
put selected tables onto clipboard didn't work.

Could someone please provide me with sample code to find the tables, put
them onto the clipboard and paste them into Excel? I am using OfficeXP but
users may have later editions, including Office 2007.

All suggestions would be greatly appreciated!


Bonsai Bill

Importing Word tables into Excel
 
Thanks for the lead. It was of some help but knowing about the site was
probably the most valuable!

After working more with code and file I determined that the table wasn't a
table after all, just tabbed text which became obvious when seeing formatting
codes in Word.

Thanks again for your help.

"JLGWhiz" wrote:

Here is another site that deals with VBA. You seem to be aware that this is
not a single step process. I doubt that any of the responders in this forum
would try to lay out the process in a single posting. Perhaps after
reviewing the link below you can take one bite of the elephant at a time
until you eat the whole thing.

http://www.dailydoseofexcel.com/arch...t-text-in-vba/

"Bonsai Bill" wrote:

Thanks for your input. The site gives a manual way to import files.

I was not completely clear in my original statement. I need to import the
Word data onto a scratch sheet then extract only the columns of data needed
and put those onto another sheet and make calculations, all using VBA. I
would like to set it up so that user is requested to give only the path to
Word file (which I can do) and then see final results. My problem is that I
don't know enough Word VBA coding to
1) use find command to get to the table
2) select the table contents
3) place selected data on clipboard (although I found how to do that from
Help I think)
4) place contents on scratch sheet (I assume that paste can be used but are
there possible problems with that?)

Example code for doing these steps would be greatly appriciated.

"JLGWhiz" wrote:

See if this site provides any answers.

http://wagda.lib.washington.edu/gish...ial/excel.html

"Bonsai Bill" wrote:

I need to import a Word table, and its continuation, into Excel. The table is
tab delimited so cutting and pasting would be fine. I can clean it up
afterwards before using the data. In trying to impliment past postings on
this site I found that the table has vertically merged cells (generates error
5991). The other problem is that it is called "Table 6" but there are many
unnumbered tables in the document preceding it.

I can find tables because they have unique text in headings (e.g. Seq.).
Picking up proper code using the Word macro recorder to find table and then
put selected tables onto clipboard didn't work.

Could someone please provide me with sample code to find the tables, put
them onto the clipboard and paste them into Excel? I am using OfficeXP but
users may have later editions, including Office 2007.

All suggestions would be greatly appreciated!



All times are GMT +1. The time now is 10:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com