Consulting

Results 1 to 7 of 7

Thread: Excel to Word Label Mail Merge

  1. #1

    Excel to Word Label Mail Merge

    Hi everyone, I am a newbie to Excel VBA programming and am in need of some help.

    I have a column in Excel which I have named 'Label' and runs from A1:A66. I would like to be able to mail merge this into Word labels and for the contents to be inserted via a mail merge. I know you can do this easily through mail merge but I want the code to do this from within Excel, as the labels can change from XXX001, XXX002 to AAA001, AAA002 etc.

    I can get the Excel code to create my list and open word but can not get word to perform a mail merge. I have tried recording a macro and editing that but it didn't work.

    Your help and thoughts would be greatly appreciated,

    TIA

    Mikey

  2. #2
    Moderator VBAX Mentor sheeeng's Avatar
    Joined
    May 2005
    Location
    Kuala Lumpur
    Posts
    392
    Location
    Welcome to VBAX, Mike! (if I did't guess wrongly)...

    Mail merge in Excel only...A new thought for me...

  3. #3
    Thanks sheeeng.

    What I would like to Excel to do is:-

    1. I select the Office and the number and once I hit my print button from my Userform it creates my list of labels in cells A1:A66.

    2. Excel will then open Word and connect to my spreadsheet and mail merge the info in the correct location. Then print it.

    I am using Avery labels L7651. I have it working up to point 2 and from there I am lost.

    Thanks

    Mikey

  4. #4
    Can anyone help on this problem please?

    Thanks

    Mikey

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Mikey,
    Have a look at the attached. The button in Excel creates a rangename "MyData" for the selected column and then opens the MailMerge document. There is a DocumentOpen macro which merges the records to a new document and then closes the mailmerge file. This is unfortunately closing Excel also, I'm not sure yet of a way around this.
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6

    Mail Merge only selected columns?

    I would be gratful if anyone can tell me whether this routine can be change to merge only selected Excel Rows (Using the control key)?

  7. #7
    MD,

    Thanks so much, this is wonderful. But I do have one problem. This works fine when the files are saved and run from my hard drive, but when I move them to our shared drive here, the macro doesn't recognize the word file. Does it have something to do with the fact that it's a shared drive? Does anyone know if there is a way around this?

    Thanks so much,
    AJO


    Quote Originally Posted by mdmackillop
    Hi Mikey,
    Have a look at the attached. The button in Excel creates a rangename "MyData" for the selected column and then opens the MailMerge document. There is a DocumentOpen macro which merges the records to a new document and then closes the mailmerge file. This is unfortunately closing Excel also, I'm not sure yet of a way around this.
    Regards
    MD

Posting Permissions

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