Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Reformat & Combine Word Tables, Then Import Into Excel

I've got about 350 tables in Word. Each has 2 columns and 22 rows. I need
to import them into excel with 22 columns and 350 rows. The left column in
each Word table contains what will become the column title in excel. The
right column in each Word table contains what will become the data for each
record. Any help would be appreciated. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Reformat & Combine Word Tables, Then Import Into Excel


Sub GetTables()

FName = Application _
.GetOpenFilename("Word Files (*.doc), *.doc")

Set WordObject = GetObject(FName)

First = True
RowCount = 2
For Each Tble In WordObject.tables
For i = 1 To 22
If First = True Then
Data = Tble.Rows(i).Cells(1).Range
'Remove cell markers
Cells(1, i) = Left(Data, Len(Data) - 2)
End If
Data = Tble.Rows(i).Cells(2).Range.Text
'Remove cell markers
Cells(RowCount, i) = Left(Data, Len(Data) - 2)
Next i
RowCount = RowCount + 1
First = False
Next Tble
WordObject.Close savechanges = False
End Sub

"Beirdo" wrote:

I've got about 350 tables in Word. Each has 2 columns and 22 rows. I need
to import them into excel with 22 columns and 350 rows. The left column in
each Word table contains what will become the column title in excel. The
right column in each Word table contains what will become the data for each
record. Any help would be appreciated. Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Reformat & Combine Word Tables, Then Import Into Excel

Works like a charm. I thank you. My wife thanks you. Where can I learn
this stuff? Any recommendations for "Subject Matter Idiots"?

"Beirdo" wrote:

I've got about 350 tables in Word. Each has 2 columns and 22 rows. I need
to import them into excel with 22 columns and 350 rows. The left column in
each Word table contains what will become the column title in excel. The
right column in each Word table contains what will become the data for each
record. Any help would be appreciated. Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reformat Excel for Access import Maarkr Excel Discussion (Misc queries) 1 July 27th 09 09:11 PM
How to combine or import multiple Excel workbooks? Edwin Excel Worksheet Functions 6 September 28th 08 03:00 PM
Import cells from excel into word and create multiple word docs scdaddy7269 Excel Programming 2 March 20th 06 07:03 PM
Automating import of Word tables into Excel Han Excel Discussion (Misc queries) 0 January 18th 06 08:42 AM
Can you reformat order of items in Pivot Tables after refresh? marmur1 Excel Discussion (Misc queries) 1 March 21st 05 01:19 PM


All times are GMT +1. The time now is 06:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"