Consulting

Results 1 to 13 of 13

Thread: VBA - Excel/Word 2007 - Using excel to compile a report in word

  1. #1

    Question VBA - Excel/Word 2007 - Using excel to compile a report in word

    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

    Thanks

    Jose

  2. #2
    Also, thanks to the forum, its proved useful in getting me as far as opening docs and find and replace

  3. #3
    Please help me with this, youre my only hope!

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Why don't your post your workbook and word template and tell us where it goes in the Word doc.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Screenshot_2014-07-18-11-03-52.jpgScreenshot_2014-07-18-11-03-36.jpg

    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.

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    No, I was hoping to see the files, to see how it is structured, any bookmarks, etc.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    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.

  8. #8
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,642
    Use mailmerge in Word.

  9. #9
    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.

  10. #10
    July2014.xlsSales Report - Copy.doc

    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!



  11. #11
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,642
    It does.

  12. #12
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    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-prog...ml#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-prog...age-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-prog...ml#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-prog...-ms-excel.html
    ' http://www.vbaexpress.com/forum/showthread.php?t=38958
    ' http://www.excelforum.com/excel-prog...o-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-prog...rom-excel.html
    ' http://www.vbaexpress.com/forum/showthread.php?t=39586

  13. #13
    Thanks Kenneth, I shall get Reading those.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •