Word Macro to Copy Cells from Excel

winterberry

New Member
Joined
Jun 5, 2017
Messages
2
Hi, I have been Googling for quite a while now, and doing that, I have seen that most macros where written and used by Excel. I want to do a macro in word that will open a specific sheet in the excel workbook and copy its contents to a ready-made word template . Can anyone help me in achieving this? With my current code, I can just do until the opening of a certain sheet. But I cannot seem to find any code (word macro code) that can copy the contents and paste it in a ready made word template. Thanks guys.
 

silentwolf

Well-known Member
Joined
May 14, 2008
Messages
1,108
Hi Winterberry,
maybe you should post your code what you already have into the thread that will help to understand what you have been doing.
Secondly you should look into bookmarks I think it is called in english those are needet to place data from excel into the word document...
Have a look if you can find any information about that on the net.

Should get you at least started on here so more can help.
 

winterberry

New Member
Joined
Jun 5, 2017
Messages
2
Word VBA to copy from excel data

Hi, I have an excel with exactly 120 rows and 4 columns. I want to auto populate those data into a word template(copy it to word application). But I cannot seem to find any word vba that does that, I mostly find excel vbas. I'm a newbie in doing macro, and what I have done so far is opening the excel and sheet that I need? Can anyone help me with this? Or at least guide me in how to copy the data from excel to word. TIA

The code so far
Code:
Dim oExcel As Excel.Application
Dim oWB As Workbook
Set oExcel = New Excel.Application
Set oWB = oExcel.Workbooks.Open("C:\Users\Berry\Documents\Meds.xls")
oExcel.Visible = True


oWB("Sheet2").Activate


Dim oWord As Object
Set oWord = CreateObject("Word.Application")
Dim oWW As Object
Set oWW = Documents.Open(":\Users\Berry\Documents\temp2.docm")
oWord.Visible = True
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
51,771
Office Version
365
Platform
Windows
Re: Word VBA to copy from excel data

I have merged your two threads together. All clarifications, follow-ups, and bumps should be posted back to the original thread. Per forum rules, posts of a duplicate nature will be locked or deleted (rule #12 here: Forum Rules).
 

Forum statistics

Threads
1,085,496
Messages
5,384,000
Members
401,871
Latest member
allemandi

Some videos you may like

This Week's Hot Topics

Top