+ Reply to Thread
Results 1 to 5 of 5

Exporting selected data from Excel to Word

  1. #1
    Registered User
    Join Date
    05-27-2013
    Location
    Middle, Nowhere
    MS-Off Ver
    Excel 2003
    Posts
    13

    Exporting selected data from Excel to Word

    Hi I'm currently working on a project where I have to transfer specific data from an excel spreadsheet (pivot table actually) into Word documents. Basically in the excel spreadsheet i have a column for the names of students, followed by another with the respective course they have chosen, and lastly the grades they have in each course. Is it possible to have a macro create a word document, name it with the student's name, and fill in a table in the Word document using data from the excel spreadsheet? I did some research and somebody suggested using bookmarks in Word as a sort of label to make sure data from excel goes exactly where you want it in word but I have no idea how it could be incorporated into a macro. I've only been using VBA for a short while and this sounds really really complicated. Kind of lost in the sea of programming language. Any help would be much appreciated! To make things simple, let the excel file be name be sourcefile.xlsm.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Exporting selected data from Excel to Word

    A sample Excel and Word file would really help.

    Would there be a need to edit the Word document later? To update grades, maybe?

    Bookmarks are just one way of handling the data. I like tables better.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    05-27-2013
    Location
    Middle, Nowhere
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Exporting selected data from Excel to Word

    Sure! I've attached them as follows. And yes, it would be preferable if the Word Document could remain editable.

    Basically the macro I'm trying to get the macro to fill in the student number and name on the world document using the appropriate cells in excel. Ideally then it would select all the courses that particular student took and paste that into the word document with the appropriate grades and numbered accordingly as shown in the word document. [This is the complicated part given that every student takes a different number of courses.] The macro would then save as the student number and close. I have somewhat managed the front portion of this with this macro I pieced together which doesn't use bookmarks:

    Please Login or Register  to view this content.
    I know it's not a very elegant way of doing this and it does cause problems. Using the macro to paste from excel into word makes the entire table longer than one page. I don't encounter this problem while manually copying and pasting. Terribly long wall of text but thanks for reading through! I'm happy to explore other methods.
    Attached Files Attached Files

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Exporting selected data from Excel to Word

    Do you need this in Word? Are you just trying to get a hard copy? If so, we can just do all of this in Excel. Even saving each Student Report in a workbook by itself.
    Last edited by Tinbendr; 06-07-2013 at 03:33 PM.

  5. #5
    Registered User
    Join Date
    05-27-2013
    Location
    Middle, Nowhere
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Exporting selected data from Excel to Word

    hey! that's an idea, thanks! yeah it eventually will be printed into hardcopy and Word is ideal.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1