Тёмный

Import Data from Excel into Word Automatically Using VBA 

Dinesh Kumar Takyar
Подписаться 115 тыс.
Просмотров 282 тыс.
50% 1

Our Excel training videos on RU-vid cover formulas, functions and VBA or macros. Useful for beginners as well as advanced learners. New upload every Thursday.
For details you can visit our website:
www.exceltrainingvideos.com/im...
How to import data from Excel into Word automatically using VBA quickly and easily.
The main solution is how to access the Word application under different conditions. Once the Word document or file is accessible data transfer becomes easy.
Get the book Excel 2016 Power Programming with VBA: amzn.to/2kDP35V
If you are from India you can get this book here: amzn.to/2jzJGqU

Опубликовано:

 

18 июн 2014

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 101   
@minyafication
@minyafication 8 лет назад
Very well explained Dinesh. Thanks for being so patient.
@Exceltrainingvideos
@Exceltrainingvideos 8 лет назад
+minyafication Thank you!
@dustymandan2488
@dustymandan2488 4 года назад
Fantastic! Thank you so much Dinesh; excellent, clear & detailed instructions.
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Appreciate your feedback - a great motivation.
@buceador479
@buceador479 8 лет назад
thank you...very clear & informative....i would be interested in seeing how you handle inserting discrete excel data into various fields/bookmarkers etc. throughout a word document.
@jothilakshmi7842
@jothilakshmi7842 6 лет назад
Thanks Very much. Nice tutorial and its working fine!
@noahinaus
@noahinaus 4 года назад
Much appreciated Sir :) Very explanatory and this is what I've been looking for.
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Glad it helped! Please share the VBA tutorials with your friends too.
@VistaTigerEye
@VistaTigerEye 4 года назад
Excellent tutorial. It's very useful for creating customized templates (resume, CV, etc.)
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Thanks for the feedback.
@PrakashPraaku
@PrakashPraaku 6 лет назад
Awesome sir, that's a lot for this video.
@bithikachatterjee806
@bithikachatterjee806 5 лет назад
Really excellent.
@wasifabbas8160
@wasifabbas8160 6 лет назад
Its good tutorial for learning purpose
@eulenstevenserrato202
@eulenstevenserrato202 8 лет назад
well explained Dinesh. Could you give a hand with a trouble?
@konkasreekanth
@konkasreekanth 6 лет назад
great tutorial.
@ranimoskovich8879
@ranimoskovich8879 8 лет назад
Thank you!!!
@wanyikhoo9499
@wanyikhoo9499 7 лет назад
Hi, I have one word document with letterhead. Please advise how to import data from Excel into the specific Word file. Thank you.
@sethanth
@sethanth 3 года назад
Nice example. Works perfect as described.. Is there a way to wrap a header and footer in the word doc without overwriting it when the word doc gets generated?
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
Let me check.
@Jonmo994
@Jonmo994 7 лет назад
Dinesh,I have columns of information I would like to populate in paragraph form going downwards on the excel sheet. How do I make it so that the word document is populated in paragraph form, not cells, in order from A - Z (rightwards) That is to say, I need it to populate A 1-20, B 1-20, C 1-20, etc.Is there a piece of code I am missing?Thank you in advance for your help!
@alessandrogervasio6429
@alessandrogervasio6429 7 лет назад
Dears,I would like to write on VBA and what written fill a mask in word
@issaj21
@issaj21 9 лет назад
Hi Dinesh, great tutorial! just one question ,how can we import data from excel to ms word on specific headings? is this possible?
@alakanandakar6914
@alakanandakar6914 8 лет назад
I have the same question
@ArunSingh-mx6wg
@ArunSingh-mx6wg 7 лет назад
Hi Sir, how to copy data from excel to existing word in specific field. for example to name and salary from excel in word whenever we see blank space after name and salary in word. please help.
@aymanhraghi8272
@aymanhraghi8272 9 лет назад
Thanks for the tutorial please i need to customize specific fields (words) in word document(2013) and replace them from excel sheet for example replace the world [project name] and [project manager] from suitable cells contents in excel sheet (P1/Ahmad) .. grateful
@vinodganger8747
@vinodganger8747 8 лет назад
tejakpackart@gmail.c
@sunilsuwal4812
@sunilsuwal4812 7 лет назад
How to export/save as excel sheet data to Ms word file format?
@sillyant113
@sillyant113 6 лет назад
Very well explained but I kept getting syntax error. Does this not work on newer Excel?
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
Check your code step by step...
@abdulhamidalhaddadi2255
@abdulhamidalhaddadi2255 Год назад
Great, this topic close to what I am looking for: "I would like to use this feature in a different way. I have a set of records in the Excel sheet file, and each record carries a number, date, subject and other information, and I would like to create a Word document with the record number and date which I select it only". May I have a questions: 1. How can I make a command bottom for each record to run this code instead to open VBA screen? 2. In your example I want to copy Region in first line, and Sales in second line. I am waiting your reply sir. Thank you
@mdalsayed9876
@mdalsayed9876 9 лет назад
thanx
@Thejonaina
@Thejonaina 3 года назад
Hello, very good video, congratulations. But I needed this code to exclude a specific line from a word document, in this case, the caption of a table. In my case, VBA excludes, in word, the table I specified, but does not exclude its caption. Would you know how to help? Thank you!
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
You should specify the range in your code. For example instead of Worksheets(“Sheet1”).Range(“A1:D4”).Copy you would use Worksheets(“Sheet1”).Range(“A2:D4”).Copy
@RavindraKumar
@RavindraKumar 8 лет назад
we have 1000 of resume and from that we would like to extract name, email id , phone no of candidate. how we can do that?
@Berita--Terkini
@Berita--Terkini 4 года назад
This is great tutorial
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Thanks. Please share the Excel VBA tutorial with your friends also on social media.
@Berita--Terkini
@Berita--Terkini 4 года назад
Sure
@bithikachatterjee806
@bithikachatterjee806 5 лет назад
I want to write a multiple choice questions paper in ms word from a database which is kept in another word table. Please help me in this regard using vba word.
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
Have a look at this video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-9wBJDyXp2CU.html Or www.exceltrainingvideos.com/generate-test-paper-from-question-bank-using-excel-vba/
@mykchavda
@mykchavda 5 лет назад
Thank you for this video sir, But I need one more help regarding this macro code. I have one data sheet in MS Excel for multiple client records, I want to repeat header column in every record copy to excel into word. It is possible.?
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
It's not quite clear what you wish to accomplish.
@mykchavda
@mykchavda 5 лет назад
@@Exceltrainingvideos thanks for getting back to me, and let me try to make my issue a bit more clear. I have excel file with common headers and multiple values for those, and I wanna create a macro, wherein those headers are kept same with field values changing for all those header records - for eg., I have below Data in MS Excel Name - a, b, c, d Date - 1, 2, 3, 4 Cost - 10, 20, 30, 40 and my expected output in MS Word name -a Date -1 Cost 10 name - b date -2 coast - 20... Hope this helps in clarifying it a bit more
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
First do the required action in Excel itself i.e. arrange the data according to your requirements through a copy-paste looping process and then transfer the data to MS Word using the following link: www.exceltrainingvideos.com/import-data-into-word-from-excel-using-vba/ For the copy-paste using a looping process you can search: www.exceltrainingvideos.com Tip: You may also record a macro for the process in Excel.
@rampaudel4268
@rampaudel4268 4 года назад
This is nice. How can we populate data from excel to word dynamically with loop like mail merge? Suppose if I want to generate bio data/resume for a specific record from a recocrdset. I want to populate (a) specific record(s) in bookmark fields in world; not the all data from the excel workbook.
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Did you mean Word? If yes then finding bookmarks and replacing them with appropriate data and also regenerating the same bookmarks can be done with VBA. I'll make a video on this interesting topic as and when time permits.
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
In the meantime you can have a look at this VBA tutorial: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-8JmogVGOVho.html
@rampaudel4268
@rampaudel4268 4 года назад
@@Exceltrainingvideos Thank you very much; looking forward to seeing the video.
@Redeeminggracefoodpantry
@Redeeminggracefoodpantry 8 лет назад
This message all happen when I treed to open excel 10 this error may appear if visual basic application vba was not installed
@perimetrfilms
@perimetrfilms 9 лет назад
Ah, good but how can I get the date in Word just into the right place? I have two sets - name, address etc and a table like the one above. Using Mailmerge is too clumsy.
@nikhilsonkar3936
@nikhilsonkar3936 4 года назад
Hi sir... I need to edit few of the statements in the word doc based on excel inputs... Is there any code in vba for this..?
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Query not quite clear to me. Take your time and let me know the details.
@pauldclayton
@pauldclayton 7 лет назад
Hi Dinesh, I have followed this Tutorial successfully but I have a few queries: 1. The data that is transferred is not linked to the worksheet so that it updates in the Word document - How can we do this? 2. Whilst the function works OK it the macro automatically closed Word once the transfer is completed whereas I would like the document lefty open. 3. My Workbook has Multiple Sheets and I wish to export to my multi page Word Report in an order that appends the data I need in a specific order. Can this be done? Thanks in anticipation of your kind assistance.
@Exceltrainingvideos
@Exceltrainingvideos 7 лет назад
This link can help: www.thespreadsheetguru.com/blog/2014/5/22/copy-paste-an-excel-table-into-microsoft-word-with-vba
@blackjimmy1972
@blackjimmy1972 7 лет назад
I don't have a developer tab. I am on a Mac. Does that make a difference?
@Exceltrainingvideos
@Exceltrainingvideos 7 лет назад
You can display the developer tab using the 'Preferences' from the 'Excel' tab.
@pathagoraspathagoras7898
@pathagoraspathagoras7898 5 лет назад
The tutorial deals with how to export from Excel into Word. But the title is "import into Word from Excel'. Do you by any chance have a video on how to import text into Word (starting from within Word, and using VBA-Word)?
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
export from Excel into Word=import into Word from Excel Please share with your friends and on social media. You can view more videos in Hindi and English at www.exceltrainingvideos.com/
@gauravgharat006
@gauravgharat006 9 лет назад
sir nice video small help please i am a beginner, can you please help i am getting error 424 even after selecting Microsoft word through Tools>>references.
@henrikijonkoping4694
@henrikijonkoping4694 2 года назад
To create many word documents using VBA in a loop must be possible to? Do you have an example on that?
@Exceltrainingvideos
@Exceltrainingvideos 2 года назад
No
@henrikijonkoping4694
@henrikijonkoping4694 2 года назад
@@Exceltrainingvideos Thank you for the answer! But it is possible with a loop`?
@MrMohanchem
@MrMohanchem 3 года назад
Hi sir ,Is there any vba training video for excel to word using content control option?Please let me know
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
No
@MrMohanchem
@MrMohanchem 3 года назад
@@Exceltrainingvideos Hi sir Could you please help me ,Below code is working only for particular row only , I want to modify that to the selected row data or if double click on particular row data should transfer to word template: Option Explicit Const FilePath As String = "D:\vba\" Dim wd As New Word.Application Sub Button3_Click() Dim doc As Word.Document wd.Visible = True Dim Name As String Dim Age As String Name = ThisWorkbook.Sheets(1).Range("F11") 'value from sheet1 Age = ThisWorkbook.Sheets(1).Range("G11") Set doc = wd.Documents.Open(FilePath & "BOOKMARK.docx") Copy2word "NameField", Name Copy2word "AgeField", Age doc.Close wd.Quit 'MsgBox "Created files in " & FilePath & "!" End Sub Sub Copy2word(BookMarkName As String, Text2Type As String) 'copy each cell to relevant Word bookmark wd.Selection.GoTo What:=wdGoToBookmark, Name:=BookMarkName wd.Selection.TypeText Text2Type End Sub
@md.fakhrulabedinchowdhury2152
@md.fakhrulabedinchowdhury2152 4 года назад
Sir How can i looping the paste into word in every new page? That is i need to paste the data from excel to word in certain number of pages. Is it possible? Thanks in advance
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
The following code will guide: 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 Exit Sub Next i End With wddoc.Close Savechanges:=False WdApp.Quit Sheet1.Range("A1").Select Set wddoc = Nothing Set WdApp = Nothing End Sub
@chinnuparwatikar4309
@chinnuparwatikar4309 7 лет назад
sir, here I got an compiler error which is showing at the place "if wddoc is nothing then set wddoc = documents(strdocname)" what do I do now
@titushui
@titushui 5 лет назад
If wddoc Is Nothing Then Set wddoc = wdapp.Documents.Open(strdocname)
@ArsenMakaryan
@ArsenMakaryan 7 лет назад
good one, only I advice look this video in 1.5 speed :)
@Exceltrainingvideos
@Exceltrainingvideos 7 лет назад
? :)
@ArsenMakaryan
@ArsenMakaryan 7 лет назад
for Me it was too slow, and I turn video speed to 1.5 , it was good :)
@salimnaija1241
@salimnaija1241 3 года назад
hi sir, colud you please make some changes in the same progrmamme , to save the file in to a folder with a file name based on the data of a cell in the same excel sheet
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
This VBA tutorial will help: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-xHkI4Nn5nKA.html
@salimnaija1241
@salimnaija1241 3 года назад
@@Exceltrainingvideos thank you sir, but i need it to save as word format, pls help me.
@SUR-NI-VARA
@SUR-NI-VARA 3 года назад
Good Morning Dinesh, How can I run a word macro through EXCEL (macro) button. Seek a code thank you
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
This Excel tutorial will help: www.exceltrainingvideos.com/how-to-assign-recorded-macro-to-command-button-in-excel/ You can also search this channel.
@parmbirsinghgill3603
@parmbirsinghgill3603 5 лет назад
Sir how to transfer excel data to specific locations in word using vba?
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
This link will guide: www.exceltrainingvideos.com/import-data-into-word-from-excel-using-vba/
@annadurai8189
@annadurai8189 4 года назад
sir is possible to type some important points it will auto update on word
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
That's what you learnt. You can open the word document first and clear the earlier data before running the macro again.
@ezgiergen2010
@ezgiergen2010 5 лет назад
hello minute 16:50 microsoft word how did you connect
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
This link with a sample downloadable file will help: www.exceltrainingvideos.com/import-data-into-word-from-excel-using-vba/
@swarupkr.chakraborty3802
@swarupkr.chakraborty3802 6 лет назад
Sir, my excel sheet is not working with it. It copy the table format in word, but couldn't copy the data from the excel
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
This link will help: www.exceltrainingvideos.com/import-data-into-word-from-excel-using-vba/ You can also download a sample file here.
@faahxx
@faahxx 6 лет назад
it give me an error 9 at the line Worksheets("Sheet3").Range("A1:C49").Copy
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
Which line of code gets highlighted when you click on 'Debug'?
@micahhansen961
@micahhansen961 3 года назад
What if I am on a Mac and C:\ does not work?
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
This website offers superb Excel solutions for Macs: www.rondebruin.nl/mac.htm
@tewari2002
@tewari2002 9 лет назад
thanks sir..i dont have good knowledge of computer but i want to use vba in excel..i want to export some specific data from excel data sheet to word templets..is it possible ..iahave a data sheet of excel and about 300 cells..and a letter on word..now i want to import data from excel once to made 300 letters for 300 people with their name address and all data ..
@mdalsayed9876
@mdalsayed9876 9 лет назад
use Mail Marge
@gendo-mailmergemadesimple.1296
+girish tewari you can try gendo.me , it is built specifically for that
@Berita--Terkini
@Berita--Terkini 4 года назад
Whats wrong whit my program. The msgbox is work
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
Great!
@asfandiaransari9037
@asfandiaransari9037 3 года назад
please share website name
@Exceltrainingvideos
@Exceltrainingvideos 3 года назад
www.exceltrainingvideos.com/
@gamzeaksoy5422
@gamzeaksoy5422 Год назад
Bazı şarkıları herkes keşfetmesin istiyorum :)
@mannyamparo1479
@mannyamparo1479 5 лет назад
Sorry ... it was not pasted.
@AnandKumar-sg4pg
@AnandKumar-sg4pg 6 лет назад
Hi Dinesh, You have given the title of this video as "Import Data from Excel into Word Automatically Using VBA" but this video is showing only how to convert from Word to Word file. Disappointed and Stereotype codes!
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
Regret to inform that this video does exactly what is promised.
@uniquedesign5680
@uniquedesign5680 Год назад
You're saying "Import Data from Excel into Word Automatically Using VBA" while you're exporting data from excel to word, quite a deceiving title.
Далее
❤️My First Subscriber #shorts #thankyou
00:26
Просмотров 4,6 млн
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Просмотров 5 млн
It works! #beatbox #tiktok
00:15
Просмотров 2,9 млн
VLOOKUP Using VBA
21:23
Просмотров 302 тыс.
Excel Macro to create PDF files using Word template
7:29
❤️My First Subscriber #shorts #thankyou
00:26
Просмотров 4,6 млн