Import Data from Excel into Word Automatically Using VBA

  Рет қаралды 282,736

Dinesh Kumar Takyar

Dinesh Kumar Takyar

Күн бұрын

Our Excel training videos on KZbin 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.exceltraini...
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

Пікірлер: 101
@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.
@dustymandan2488
@dustymandan2488 5 жыл бұрын
Fantastic! Thank you so much Dinesh; excellent, clear & detailed instructions.
@Exceltrainingvideos
@Exceltrainingvideos 5 жыл бұрын
Appreciate your feedback - a great motivation.
@minyafication
@minyafication 8 жыл бұрын
Very well explained Dinesh. Thanks for being so patient.
@Exceltrainingvideos
@Exceltrainingvideos 8 жыл бұрын
+minyafication Thank you!
@VistaTigerEye
@VistaTigerEye 5 жыл бұрын
Excellent tutorial. It's very useful for creating customized templates (resume, CV, etc.)
@Exceltrainingvideos
@Exceltrainingvideos 5 жыл бұрын
Thanks for the feedback.
@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.
@jothilakshmi7842
@jothilakshmi7842 6 жыл бұрын
Thanks Very much. Nice tutorial and its working fine!
@eulenstevenserrato202
@eulenstevenserrato202 8 жыл бұрын
well explained Dinesh. Could you give a hand with a trouble?
@bithikachatterjee806
@bithikachatterjee806 6 жыл бұрын
Really excellent.
@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.
@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.
@wasifabbas8160
@wasifabbas8160 6 жыл бұрын
Its good tutorial for learning purpose
@PrakashPraaku
@PrakashPraaku 6 жыл бұрын
Awesome sir, that's a lot for this video.
@abdulhamidalhaddadi2255
@abdulhamidalhaddadi2255 2 жыл бұрын
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
@konkasreekanth
@konkasreekanth 7 жыл бұрын
great tutorial.
@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
@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.
@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 5 жыл бұрын
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/
@ranimoskovich8879
@ranimoskovich8879 8 жыл бұрын
Thank you!!!
@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: kzbin.info/www/bejne/bnvQoJqMfLSJntE
@rampaudel4268
@rampaudel4268 4 жыл бұрын
@@Exceltrainingvideos Thank you very much; looking forward to seeing the video.
@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 9 жыл бұрын
tejakpackart@gmail.c
@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!
@issaj21
@issaj21 10 жыл бұрын
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
@henrikijonkoping4694
@henrikijonkoping4694 3 жыл бұрын
To create many word documents using VBA in a loop must be possible to? Do you have an example on that?
@Exceltrainingvideos
@Exceltrainingvideos 3 жыл бұрын
No
@henrikijonkoping4694
@henrikijonkoping4694 3 жыл бұрын
@@Exceltrainingvideos Thank you for the answer! But it is possible with a loop`?
@Thejonaina
@Thejonaina 4 жыл бұрын
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 4 жыл бұрын
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
@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.
@pauldclayton
@pauldclayton 8 жыл бұрын
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 8 жыл бұрын
This link can help: www.thespreadsheetguru.com/blog/2014/5/22/copy-paste-an-excel-table-into-microsoft-word-with-vba
@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...
@MrMohanchem
@MrMohanchem 4 жыл бұрын
Hi sir ,Is there any vba training video for excel to word using content control option?Please let me know
@Exceltrainingvideos
@Exceltrainingvideos 4 жыл бұрын
No
@MrMohanchem
@MrMohanchem 4 жыл бұрын
@@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
@sunilsuwal4812
@sunilsuwal4812 8 жыл бұрын
How to export/save as excel sheet data to Ms word file format?
@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.
@alessandrogervasio6429
@alessandrogervasio6429 7 жыл бұрын
Dears,I would like to write on VBA and what written fill a mask in word
@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.
@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
@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.
@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.
@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: kzbin.info/www/bejne/rnnOemeEo5qhgaM
@salimnaija1241
@salimnaija1241 3 жыл бұрын
@@Exceltrainingvideos thank you sir, but i need it to save as word format, pls help me.
@RavindraKumar
@RavindraKumar 9 жыл бұрын
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?
@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
@mdalsayed9876
@mdalsayed9876 9 жыл бұрын
thanx
@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.
@bithikachatterjee806
@bithikachatterjee806 6 жыл бұрын
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 6 жыл бұрын
Have a look at this video: kzbin.info/www/bejne/b6ile3evjdVlebc Or www.exceltrainingvideos.com/generate-test-paper-from-question-bank-using-excel-vba/
@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 5 жыл бұрын
sir is possible to type some important points it will auto update on word
@Exceltrainingvideos
@Exceltrainingvideos 5 жыл бұрын
That's what you learnt. You can open the word document first and clear the earlier data before running the macro again.
@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.
@Berita--Terkini
@Berita--Terkini 4 жыл бұрын
Whats wrong whit my program. The msgbox is work
@Exceltrainingvideos
@Exceltrainingvideos 4 жыл бұрын
Great!
@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'?
@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)
@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
@asfandiaransari9037
@asfandiaransari9037 3 жыл бұрын
please share website name
@Exceltrainingvideos
@Exceltrainingvideos 3 жыл бұрын
www.exceltrainingvideos.com/
@ezgiergen2010
@ezgiergen2010 6 жыл бұрын
hello minute 16:50 microsoft word how did you connect
@Exceltrainingvideos
@Exceltrainingvideos 6 жыл бұрын
This link with a sample downloadable file will help: www.exceltrainingvideos.com/import-data-into-word-from-excel-using-vba/
@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
@gendo-mailmergemadesimple.1296 9 жыл бұрын
+girish tewari you can try gendo.me , it is built specifically for that
@gamzeaksoy5422
@gamzeaksoy5422 Жыл бұрын
Bazı şarkıları herkes keşfetmesin istiyorum :)
@mannyamparo1479
@mannyamparo1479 5 жыл бұрын
Sorry ... it was not pasted.
@uniquedesign5680
@uniquedesign5680 2 жыл бұрын
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.
@AnandKumar-sg4pg
@AnandKumar-sg4pg 7 жыл бұрын
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 7 жыл бұрын
Regret to inform that this video does exactly what is promised.
Free Excel VBA Course #35 - Creating Word Reports Using VBA
25:23
(1/2) Automating Word Documents from Excel - No VBA
4:37
Andrew Ligon Fant
Рет қаралды 368 М.
The selfish The Joker was taught a lesson by Officer Rabbit. #funny #supersiblings
00:12
Spongebob ate Michael Jackson 😱 #meme #spongebob #gmod
00:14
Mr. LoLo
Рет қаралды 10 МЛН
GIANT Gummy Worm Pt.6 #shorts
00:46
Mr DegrEE
Рет қаралды 114 МЛН
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Паша Осадчий
Рет қаралды 10 МЛН
Mail Merge from Excel to Microsoft Word
15:03
Technology for Teachers and Students
Рет қаралды 2,6 МЛН
Transfer data from one Excel worksheet to another automatically
17:20
Dinesh Kumar Takyar
Рет қаралды 1,2 МЛН
How To Create Custom Letters In Word Documents From Excel WITHOUT Mail Merge
37:22
Push Data from Excel to MS Word Content Controls using Excel VBA
7:55
Dr. Todd Grande
Рет қаралды 93 М.
VLOOKUP Using VBA
21:23
Dinesh Kumar Takyar
Рет қаралды 302 М.
VBA - Création d'un rapport Word à partir d'Excel
28:04
Learnaccess
Рет қаралды 9 М.
The selfish The Joker was taught a lesson by Officer Rabbit. #funny #supersiblings
00:12