How to import data from Word tables into Excel with VBA

  Рет қаралды 40,365

Dinesh Kumar Takyar

Dinesh Kumar Takyar

Күн бұрын

Пікірлер: 53
@DrFunkNStein-ol4zo
@DrFunkNStein-ol4zo 5 жыл бұрын
Dinesh! My man! Thank you so much! Have a great summer and KIT!
@tb2324
@tb2324 4 ай бұрын
I know this is an old video and not sure If you still read these. What if you want to pull the word table data like you are doing, but on an open word doc? Example. You are emailed a word file daily and no need to save it. You go to your master excel file and run your macro to pull in the data. That way, you can use that excel file for a specific job
@Garudgaming-yt
@Garudgaming-yt 2 жыл бұрын
Can we get each table in separate sheets in excel. Please tell
@jacodevilliers1937
@jacodevilliers1937 5 жыл бұрын
Great Work and Thanks!
@Exceltrainingvideos
@Exceltrainingvideos 5 жыл бұрын
You are welcome. Please share with your friends also.
@BJNLAZAREVIC
@BJNLAZAREVIC 7 жыл бұрын
Dear Mr. Dinesh, I was searching for the method to import text from Word into Excel and found this video of yours. In my case I would simply need to copy the first line of the textual document at the Page1 (Word) and to copy it to Sheet 1 in Excel. I have 250 such pages in Word and I need VBA macro to perform aforementioned operation automatically for every single page(word)/sheet(excel). Is it feasible? I searched about 4 hours for the solution online and haven't managed to found one.
@mail2arunjith
@mail2arunjith 7 жыл бұрын
Thank you for this wonderful video. This was exactly what i was looking for and you have saved my day.
@darthsavage4025
@darthsavage4025 5 жыл бұрын
Thank you very much for the awesome tutorial! If I have a Word file that includes 4 tables; and I want each table to be added to their own sheet (which would need to be created); how would I accomplish this?
@Exceltrainingvideos
@Exceltrainingvideos 5 жыл бұрын
Sub importTableDataWord() Dim WdApp As Object, wddoc As Object Dim strDocName As String On Error Resume Next Set WdApp = GetObject(, "Word.Application") If Err.Number = 429 Then Err.Clear Set WdApp = CreateObject("Word.Application") End If WdApp.Visible = True strDocName = "C:\our-inventory\inventory.docx" If Dir(strDocName) = "" Then MsgBox "The file " & strDocName & vbCrLf & _ "was not found in the folder path" & vbCrLf & _ "C:\our-inventory\.", _ vbExclamation, _ "Sorry, that document name does not exist." Exit Sub End If WdApp.Activate Set wddoc = WdApp.Documents(strDocName) If wddoc Is Nothing Then Set wddoc = WdApp.Documents.Open(strDocName) wddoc.Activate Dim Tble As Integer Dim rowWd As Long Dim colWd As Integer Dim x As Long, y As Long x = 1 y = 1 With wddoc Tble = wddoc.tables.Count Worksheets.Add after:=Sheet1, Count:=(Tble - 1) 'MsgBox Tble If Tble = 0 Then MsgBox "No Tables found in the Word document", vbExclamation, "No Tables to Import" Exit Sub End If j = 1 For i = 1 To Tble With .tables(i) For rowWd = 1 To .Rows.Count For colWd = 1 To .Columns.Count Sheets("Sheet" & j).Cells(x, y) = WorksheetFunction.Clean(.cell(rowWd, colWd).Range.Text) y = y + 1 Next colWd y = 1 x = x + 1 Next rowWd End With j = j + 1 y = 1 x = 1 If j > Tble Then wddoc.Close Savechanges:=False End If Next i End With WdApp.Quit Sheet1.Range("A1").Select Set wddoc = Nothing Set WdApp = Nothing End Sub
@cpkoek
@cpkoek 9 жыл бұрын
can we use this application to extract data from multiple word to 1 excel file? every incremental of the word files will also appear in the excel. actually i wanted to compile all required information in all release revision in 1 excel, not sure it is durable?
@deepakbhanushali1
@deepakbhanushali1 4 жыл бұрын
what a wonderful video thank Sir Sir I did the same but one problem presist in word file table i want to insert row 1,2 and skip 3 and 4 ,5 skip 6 in a multiple (skiping all the rows multiple by 3) what should be done in my word tabel 1row2column value is 2020.04 and 2ndrow3coumn its date (25) can it be merged while replace it in excel vba
@Exceltrainingvideos
@Exceltrainingvideos 4 жыл бұрын
In the 'for loop' you can use step 3. eg. For i= 1 to x step 3
@deepakbhanushali1
@deepakbhanushali1 4 жыл бұрын
@@Exceltrainingvideos thanks sir it worked
@CoderWave
@CoderWave 3 жыл бұрын
I want to copy table from word where table has very large data in 1 cell which has some links and data formatting in it ...is there any way to copy as it is in excel
@Exceltrainingvideos
@Exceltrainingvideos 3 жыл бұрын
Try copy pastespecial. This Excel VBA tutorial will also help: www.exceltrainingvideos.com/how-to-import-data-from-word-tables-into-excel-with-vba/ You can search this channel or our website.
@CoderWave
@CoderWave 3 жыл бұрын
@@Exceltrainingvideos link is not working but I want 50 lines data in a single cell with different formatting on each line with some hyperlink in data . Will it help?
@stefaniecheng
@stefaniecheng 3 жыл бұрын
Is it possible to transfer the content table-within table from word into excel using vba?
@Exceltrainingvideos
@Exceltrainingvideos 3 жыл бұрын
Give an example.
@khajamk9258
@khajamk9258 3 жыл бұрын
Hi sir I need your help I want to copy data only which is in numbers . Is this possible from word to excel. Please reply. Thanks.
@Exceltrainingvideos
@Exceltrainingvideos 3 жыл бұрын
Yes. This link will guide: www.exceltrainingvideos.com/how-to-extract-numbers-from-alphanumeric-text-in-excel/
@abhisheksomashekar2259
@abhisheksomashekar2259 4 жыл бұрын
Hello Dinesh Sir, I want to know how to copy a specific table in a Word Document from a group of tables to another word document? Can you please help
@Exceltrainingvideos
@Exceltrainingvideos 4 жыл бұрын
Will work on this good idea.
@kamalakotagiri7174
@kamalakotagiri7174 4 жыл бұрын
Hi Dinesh- Can we snip some part of word doc paste into Excel as image? Please reply
@Exceltrainingvideos
@Exceltrainingvideos 4 жыл бұрын
I use the Fn + PRT SC keys to take a snap.
@kamalakotagiri7174
@kamalakotagiri7174 4 жыл бұрын
@@Exceltrainingvideos I need VBA solution to capture a table as bitmap. Is it possible ?
@Exceltrainingvideos
@Exceltrainingvideos 4 жыл бұрын
Need VBA solution? Ready to pay for it?
@barbarawarren6203
@barbarawarren6203 7 жыл бұрын
Hello Sir, Can you do a similar video for copying data from Word to Excel that shows how to loop through multiple Word files in a folder?
@Exceltrainingvideos
@Exceltrainingvideos 7 жыл бұрын
Use a looping process to access each file. This video will guide: www.exceltrainingvideos.com/transfer-data-multiple-workbooks-master-workbook-automatically/ Or search my website www.exceltrainingvideos.com
@corneliusmertzlufft-paufle1726
@corneliusmertzlufft-paufle1726 6 жыл бұрын
Thank you for this valuable code. However, if my table contains numbers (currency), it will convert to text, not to numbers format. This makes it difficult to process the imported numbers. Do you have a solution for this?
@Exceltrainingvideos
@Exceltrainingvideos 6 жыл бұрын
I had no problems: www.exceltrainingvideos.com/how-to-import-data-from-word-tables-into-excel-with-vba/
@boriszaitsev3211
@boriszaitsev3211 4 жыл бұрын
How to do it work with nested table?!
@Exceltrainingvideos
@Exceltrainingvideos 4 жыл бұрын
Can you elaborate?
@boriszaitsev3211
@boriszaitsev3211 4 жыл бұрын
@@Exceltrainingvideos For example, document has different tables. Some of them have nested tables. It is necessary to extract data from table with cells size 16*N (lets name it "D"). It is fourth nested table in another parent table in cell 1,1 (lets name it "C"). Table "C" is second nested in another parent table "B" in cell 1,1. Table "A" has only one nested table "B" in cell 1,1.
@JokoEngineeringhelp
@JokoEngineeringhelp 9 жыл бұрын
If I am getting "No Tables Found in word document" and when I remove on error remove next I find that GetObject and CreateObject both don't create the word application. (Getting Error 429 still) Any suggestions?
@corneliusmertzlufft-paufle1726
@corneliusmertzlufft-paufle1726 6 жыл бұрын
Joko Engineeringhelp did you receive any hints to solve the problem? I encounter the same.
@srinivassri7067
@srinivassri7067 4 жыл бұрын
Sir, Could you help in providing a solution for the below problem. There are multiple tables in my word document. How can i extract specific tables having data into excel sheet using word VBA. I do not want all tables to be imported. each tables has different columns and data with merged columns in it.
@Exceltrainingvideos
@Exceltrainingvideos 4 жыл бұрын
Will work on this idea.
@thaddeusspann1039
@thaddeusspann1039 5 жыл бұрын
Code doesn't work. Says no tables found when there are hundreds of tables.
@Exceltrainingvideos
@Exceltrainingvideos 5 жыл бұрын
Check your code here. You'll also be able to download the actual file for practice: www.exceltrainingvideos.com/how-to-import-data-from-word-tables-into-excel-with-vba/
@mouneshwarbadiger7335
@mouneshwarbadiger7335 7 жыл бұрын
Hi Sir, Thank you so much for this video, I observed that it is not copying the format of the text(Ex : if some of the words are bold in word file then those are not copying with the same format). could you please help me to get the format also....
@Exceltrainingvideos
@Exceltrainingvideos 7 жыл бұрын
www.exceltrainingvideos.com/copy-data-paste-another-workbook-transpose-automatically-using-excel-vba/ www.exceltrainingvideos.com/paste-special/ www.exceltrainingvideos.com/how-to-copy-a-word-table-into-excel/
@mouneshwarbadiger7335
@mouneshwarbadiger7335 7 жыл бұрын
These links are useful only if we are doing manually, is it possible to add a paste special option in this video's code itself? so that it can copy the word file table data(with the format) and paste it into excel(with the same format).
@aceace4917
@aceace4917 4 жыл бұрын
Hi Sir! I've got an error of Variable not defined for "i". What should I do?
@Exceltrainingvideos
@Exceltrainingvideos 4 жыл бұрын
Declare the variable i. Dim i as Long
@john-vb5fw
@john-vb5fw 8 жыл бұрын
Hi Dinesh im struggling with a project could you help via email so i can send a file to you with a description of what i need ?
@majidal-haddabi6302
@majidal-haddabi6302 9 жыл бұрын
can you send us the VBA code for this application
@Exceltrainingvideos
@Exceltrainingvideos 9 жыл бұрын
+Majid Al-Haddabi www.exceltrainingvideos.com/how-to-import-data-from-word-tables-into-excel-with-vba/
@lenovoomobile8518
@lenovoomobile8518 8 жыл бұрын
I have a table in microsoft word. Table format is same on 20 pages but entries are different. I want to import this data in excel but in specific rows and columns in excel. Columns title is same as in different entries of word. How can I import this data so that all data of one table in work should be imported in one row of excel. Thanks
@jsprite123
@jsprite123 8 жыл бұрын
It would really help if you indent your "If" and "For" statements, otherwise it is hard to follow.
@Exceltrainingvideos
@Exceltrainingvideos 8 жыл бұрын
OK
@Exceltrainingvideos
@Exceltrainingvideos 7 жыл бұрын
These links will guide: www.exceltrainingvideos.com/copy-data-paste-another-workbook-transpose-automatically-using-excel-vba/ www.exceltrainingvideos.com/paste-special/ www.exceltrainingvideos.com/how-to-copy-a-word-table-into-excel/
@xuenen
@xuenen 10 жыл бұрын
Why dimming as generic Object? You have to do the CreateObject and GetObject and you have no Intellisense. You could have done this to avoid all of that: Dim wdApp As New Word.Application Dim wdDoc As Word.Document
@Exceltrainingvideos
@Exceltrainingvideos 10 жыл бұрын
Alan Sonnenberg Thanks!
Wise Owl Answers - How do I copy Word tables into Excel using VBA?
8:02
Обучение EXCEL. УРОК 9: Умные таблицы EXCEL (динамический диапазон, DATA TABLES).
16:09
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
VBA Macro Code - Copy Data from Multiple Word Files to Excel
10:22
Learn Excel VBA
Рет қаралды 14 М.
Introducing Python in Excel
19:01
Leila Gharani
Рет қаралды 1,7 МЛН
Get Data from Microsoft Word Forms into Excel Using VBA
23:48
Dinesh Kumar Takyar
Рет қаралды 79 М.
Macro to extract data from Word table to Excel | Excel VBA
12:49
Extreme Automation - Kamal Girdher
Рет қаралды 42 М.
Unlock Excel Secrets: Magic Search Bar You NEVER Knew About!
17:59
PK: An Excel Expert
Рет қаралды 545 М.
How to Easily Create a Data Entry Form in Excel | No VBA
22:30
Jopa Excel
Рет қаралды 58 М.
Excel VBA Macro: Create Word Document & Add Table (Static Range)
9:32
Copy Data from Microsoft Word to Excel using Excel VBA
9:29
Dr. Todd Grande
Рет қаралды 35 М.
Exporting Word Form Data to Excel
14:11
Neil Malek
Рет қаралды 174 М.