PDA

View Full Version : VBA - Excel/Word 2007 - Using excel to compile a report in word



josedotcom
07-17-2014, 05:00 AM
Hello,

I've been struggling with this for a week or so now. I am looking to use a worksheet in Excel to populate a word template. The data in excel will be used to populate the template. This will mean different formatting for many of the sections.

As an example:
Excel would be basically two columns with 'A' as a constant header such as 'Date' and 'B' would be the variable '16/07/2014' The formating would be Arial size 12 bold.

I would need this input into the word document, I've tried to do this using find and replace as well as copy and paste but with no luck. If I could please have help getting started hopefully I can suss out the rest :yes: pray2:

Thanks

Jose

josedotcom
07-17-2014, 05:02 AM
Also, thanks to the forum, its proved useful in getting me as far as opening docs and find and replace :)

josedotcom
07-18-2014, 12:57 AM
:help:igiveup:Please help me with this, youre my only hope!

Bob Phillips
07-18-2014, 01:00 AM
Why don't your post your workbook and word template and tell us where it goes in the Word doc.

josedotcom
07-18-2014, 08:20 AM
1198111982

Hope this helps. The template in word would be blank except from the headings. I've shown where I would want the text to end up. Any help is appreciated beyond belief :) thanks.

Bob Phillips
07-21-2014, 06:19 AM
No, I was hoping to see the files, to see how it is structured, any bookmarks, etc.

josedotcom
07-22-2014, 03:29 AM
I will upload the files as soon as I can. Thanks for your help. As far as I know they are just basic files as I just opened up word and excel and started typing.

snb
07-22-2014, 05:38 AM
Use mailmerge in Word.

josedotcom
07-22-2014, 06:41 AM
I did look at this but did not think it would cater for what I am trying to do. I could not see a way of editing the headings on mail merge, such as address. Ultimately, I want to be able to click a button and the report be made from the spread sheet, mail merge would be a bit more work than that wouldn't it? Thanks for your help, it is appreciated.

josedotcom
07-22-2014, 07:15 AM
1200112002

These are my drafts so far that I have been trying to work with. I've been relooking at some of the similar queries and feel significantly out of my depth!


:ohwell:

snb
07-22-2014, 09:20 AM
It does.

Kenneth Hobs
07-22-2014, 01:29 PM
It can be involved for those not used to doing it.

See the link to the bookmarks which might help.

'TypeText method
' http://www.excelforum.com/excel-programming/650672-populate-word-document-from-excel.html#post1946784
' http://www.excelforum.com/showthread.php?p=1946784
' http://vbaexpress.com/forum/showthread.php?p=169877
' http://vbaexpress.com/forum/showthread.php?t=24693
' http://www.excelforum.com/excel-programming/791302-excel-to-word-paragraph-and-page-setup.html


'Copy from Excel, paste to Word
'Lucas, http://vbaexpress.com/forum/showthread.php?p=178364


'FormFields
' http://www.mrexcel.com/forum/showthread.php?p=1639696
' http://www.mrexcel.com/forum/showthread.php?t=333200


'Add Hyperlink to Bookmark
' http://www.excelforum.com/excel-programming/664078-use-excel-vba-to-add-a-hyperlink-to-a-word-document.html#post2006430
'Steiner, http://www.vbaexpress.com/kb/getarticle.php?kb_id=126
'Colin_L, http://www.mrexcel.com/forum/showthread.php?t=358054


'Save OLEObject as MSWord Document
' http://vbaexpress.com/forum/showthread.php?t=21619


'Add Table to MSWord
' http://vbaexpress.com/forum/showthread.php?t=23975
' http://vbaexpress.com/forum/showthread.php?p=168731


'Import Word Tables
'vog, http://www.mrexcel.com/forum/showthread.php?t=382541


'Save OLEObject as MSWord DOC
' http://vbaexpress.com/forum/showthread.php?t=21619


'Get Optionbutton info from MSWord DOC
' http://vbaexpress.com/forum/showthread.php?t=22454


'FindReplace Text
' http://www.excelforum.com/excel-programming/682014-replace-word-in-ms-word-with-varable-from-ms-excel.html
' http://www.vbaexpress.com/forum/showthread.php?t=38958
' http://www.excelforum.com/excel-programming/794297-struggling-with-a-find-replace-macro-to-word.html
' http://www.mrexcel.com/forum/showthread.php?t=588688


'Bookmarks
' http://vbaexpress.com/forum/showthread.php?p=185718
'Colin_L, http://www.mrexcel.com/forum/showthread.php?t=358054


'Mail Merge
' http://www.excelforum.com/excel-programming/796614-mail-merge-from-excel.html
' http://www.vbaexpress.com/forum/showthread.php?t=39586

josedotcom
07-24-2014, 01:21 AM
Thanks Kenneth, I shall get Reading those.