+ Reply to Thread
Results 1 to 11 of 11

creating one address label for different people with the same address

  1. #1
    Registered User
    Join Date
    04-02-2012
    Location
    Sidney, BC
    MS-Off Ver
    Excel 2010
    Posts
    39

    creating one address label for different people with the same address

    I have an Excel spreadsheet sorted alphabetically by last name with several columns among which are (not necessarily in this order): last_name, first_name, address, mailing_label_address. The mailing_label_address will be such that I can use it as an inserted field in a Word mail merge to create mailing labels.

    Some of the people listed in the spreadsheet have the same address. As I want to send only one letter to that address, the mailing_label_address will have one of two forms. If the people with the same address have the same last name, e.g., a married couple, the mailing_label_address would look like this:

    John and Mary Doe
    5 Main St.
    Victoria BC

    If the people have different last names, the mailing_label_address would look like this:

    John Doe
    Mary Roe
    5 Main St.
    Victoria BC

    This mailing address would appear in the mailing_label_address column for only one of the two people. It would be blank for the other person.

    Is there a way to do this using Excel formulas or would a macro be needed? I do not do VBA programming, so if a macro is needed I would need someone on the forum to supply it.

    Thanks for any help with this.
    -- Art

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: creating one address label for different people with the same address

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    04-02-2012
    Location
    Sidney, BC
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: creating one address label for different people with the same address

    Thanks for the good advice, Orrin. I've attached a workbook with before and after sheets. It can be seen on the before sheet two columns that are empty because I don't know how to code in the information that can be seen in the after sheet. I hope this provides whatever info the Excel gurus on this need to provide the macro or whatever is needed to accomplish the task. --Art
    Attached Files Attached Files
    Last edited by amenu; 03-25-2018 at 06:50 PM. Reason: I needed to correct the file I first uploaded

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: creating one address label for different people with the same address

    Try this:

    Please Login or Register  to view this content.
    Last edited by xladept; 03-26-2018 at 01:41 PM.

  5. #5
    Registered User
    Join Date
    04-02-2012
    Location
    Sidney, BC
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: creating one address label for different people with the same address

    Hi Orrin,

    Thank you for what looks like a lot of work on your part. I installed the macro in my spreadsheet and when I ran it from
    the VB window the attached error message appeared. I look forward to hearing from you again!
    -- Art
    Attached Images Attached Images

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: creating one address label for different people with the same address

    amenu,

    Any chance you didn't fully copy xladept's code? I tested it on my end using your file and his code, and could not duplicate your error.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: creating one address label for different people with the same address

    Thanks Arkadi!

    @ amenu

    Or, if you did copy the whole code then maybe the End With has to stand alone so just hit the enter key on the colon so that End Sub is also by itself

  8. #8
    Registered User
    Join Date
    04-02-2012
    Location
    Sidney, BC
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: creating one address label for different people with the same address

    Hi Orrin,
    I put the End Sub on its own line but am now getting a different error message. I've attached two images. One shows the error message and the other the macro as I have copied and pasted it with the error highlighted in yellow. I hope this provided a clue.
    -- Art
    Attached Images Attached Images

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: creating one address label for different people with the same address

    Your sheet name must be exact in the code so, if you have a different sheet name replace the "Before" with that name

  10. #10
    Registered User
    Join Date
    04-02-2012
    Location
    Sidney, BC
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: creating one address label for different people with the same address

    Yup, I had to replace "Before" with "Sheet2" and rearrange some pre-existing columns that were not in the sample workbook I posted. With that done, it worked a charm. I can't tell you how grateful I am. I am volunteering at a church and some of their office procedures are very inefficient. Excel is not used at all. With the Excel spreadsheet I have created and the macro you created, it will save the office administrator a lot of time. Thank you! --Art

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: creating one address label for different people with the same address

    You're welcome and belated thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Last edited by xladept; 03-26-2018 at 04:45 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Address Label Creation Macro
    By JustinM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-21-2012, 04:41 PM
  2. Replies: 2
    Last Post: 09-06-2012, 04:11 AM
  3. To Print Address Label
    By ramsdesk in forum Excel General
    Replies: 0
    Last Post: 08-16-2010, 10:32 AM
  4. Excel 2008 : how to put names into address label format
    By buyahh72 in forum Excel General
    Replies: 4
    Last Post: 04-05-2010, 08:25 AM
  5. Copy address label from row to column
    By david747 in forum Excel General
    Replies: 2
    Last Post: 09-12-2007, 12:20 PM
  6. Address label help
    By lost printer in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 01-03-2006, 05:50 PM
  7. How do I put the zip code in the address label?
    By xsell in forum Excel General
    Replies: 1
    Last Post: 12-01-2005, 11:35 AM

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