+ Reply to Thread
Results 1 to 2 of 2

Need help in splitting excel spreadsheet and export data to Word Document

  1. #1
    Registered User
    Join Date
    06-10-2010
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    1

    Need help in splitting excel spreadsheet and export data to Word Document

    Hi there...

    Im trying to acheive something in excel at work - and Ive been trying for the past 2 days with no positive outcome - can someone please help me or give me any advice?

    So here is what Im trying to do. Ive attached 2 files. Trial.XLS and Trail.DOC.

    1. Trail.XLS is the main host file. You can see columns with data in them. (Name, Title, Email and Identifier)
    2. Identifier data is populated with either "T" or "F"
    3. Everytime you see a "T" in Identifier, it means that its a new company. All the rows with the "F" identifier that follow the previous T belong to the same company.
    4. I need to be able to split the table in excel whenever a "T" is encountered in the Identifier column - and then each split is exported into a Table in the Word doc.
    5. Trail.xls is your before file, and Trial.doc is your After file. The end product should be what Trial.doc looks like. All the data is split up depending on the "T" identifier.

    I hope I have explained that properly. Please let me know if you need me to clarify anything. Ive been trying/reading all sorts of Excel help/export stuff online, but cant find anything that benefits me - or maybe I just dont know. Im a noob when it comes to excel. Any feedback is truly appreciated
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,923

    Re: Need help in splitting excel spreadsheet and export data to Word Document

    Here is a VBA solution. Save the file, open it, and follow these steps:

    For Excel VBA to interact with a Word document, you need to add a reference to Microsoft Word in Excel. To do that follow these instructions:
    1. In Excel, press ALT-F11. This will open the VBA environment.
    2. From the menu select Tools, References
    3. Scroll down to find "Microsoft Word xx.x Object Library" (the actual version isn't important, it will probably list just one)
    4. Check the box and press OK.
    5. Close the VBA environment.
    6. Save your Excel file.
    Now you are ready to press the Export button.

    It will create the Word file, save it, and leave it open.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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