+ Reply to Thread
Results 1 to 4 of 4

LABELS - MS word - using if function

  1. #1
    Registered User
    Join Date
    03-10-2009
    Location
    La La Land
    MS-Off Ver
    Excel 2003
    Posts
    36

    Unhappy LABELS - MS word - using if function

    Hello,

    I have a template here that I am using for printing labels, it has generic data, such as:

    <Title>. <First Name> <Last Name>
    <Address 1>
    <Address 2>
    <Postal Code>


    the problem I face is if my excel spreadsheet doesn't have a <Title>, it appears as..


    . John Smith
    123 Madeup Street
    Wonderland, DisneyLand
    000 000


    How can I have the period removed along with the title if the spreadsheet doesn't have the Title field?

    There is a period in the template as the excel file does not include the period after the Mr. or Mrs.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: LABELS - MS word - using if function

    Alt-F9

    PHP Code: 
    { if  {MERGEFIELD title}="" "" "{MERGEFIELD title}."



  3. #3
    Registered User
    Join Date
    08-23-2011
    Location
    NYC
    MS-Off Ver
    Excel 2019/O365
    Posts
    60

    Re: LABELS - MS word - using if function

    or

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-23-2011
    Location
    NYC
    MS-Off Ver
    Excel 2019/O365
    Posts
    60

    Wink Re: LABELS - MS word - using if function

    Try this.

    I used the\f switch, that is after pressing Alt + F9:

    Please Login or Register  to view this content.
    which means:

    If the record is not empty add the delimiter in quotes (. ) after the entry otherwise nothing is displayed.

    Another helpful switch is \b which is the same idea except if the value is not empty it will add the delimiter in quotes before the entry.

    More on that here under switches.
    Attached Files Attached Files

+ 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