+ Reply to Thread
Results 1 to 2 of 2

VBA Deleting Empty Lines from Email Body

  1. #1
    Registered User
    Join Date
    06-26-2015
    Location
    St.Paul, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    37

    VBA Deleting Empty Lines from Email Body

    Hi,

    I've got an email macro that pulls items from my workbook and generates an email requesting that particular information. In the macro i've got it set to create a set amount of blank spaces, roughly 10, in case we every need to request that many items. However, when I'm requesting only say 2 or 3 items, the blank spaces leave a large gap between the body text and the closing statement in the email. I'm wondering if there's a code I could include that will delete empty lines in the text body of the email if no values are assigned to them. Heres my code as of now, I'm referring to the multiple "& vbNewLine" entries. Thanks!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: VBA Deleting Empty Lines from Email Body

    Here is something I've used in the past. If I'm not mistaken, it only "copies" the cells that have data in them and places it in the email
    1st part
    Please Login or Register  to view this content.
    2nd part
    Please Login or Register  to view this content.
    These are 2 separate "subs" but, one wont work without the other.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

+ 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. How to send email from excel using VBA with Cell Range (Including Images) as Email Body
    By Novice_To_Excel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-24-2014, 05:06 AM
  2. vba pull data from outlook body of email through email or subject of mail into excel
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 04:37 AM
  3. Send New Email W/ Body of Received Email, Then Delete Sent Email
    By edneal2 in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 07-01-2013, 12:45 AM
  4. Qutlook email with signature using body message from cell values
    By gmc2k2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2013, 10:11 AM
  5. export outlook 2007 email into excel with subject and body of email
    By akulka58 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2013, 02:37 PM

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