+ Reply to Thread
Results 1 to 2 of 2

IF Statement within OutApp in VBA

  1. #1
    Registered User
    Join Date
    11-10-2016
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    18

    IF Statement within OutApp in VBA

    Hey guys,

    Two questions but 1. is more important.

    1. How do I include an IF statement within the .body of an outlook e-mail. Essentially I have 5 lines in my excel file and only want to include those items in my e-mail if they're included. In the text, it's IF(B4="","",B4) but when I include IF RANGE("B4").VALUE = "" THEN "" ELSE RANGE("B4").VALUE, it's giving me an error.

    2. Is it possible to create a messagebox that says if RANGE("B4").VALUE = "" THEN (create box that says "TEXT")


    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: IF Statement within OutApp in VBA

    I would put your IF statement before the With OutMail, create a String variable to hold your .Body text and add to it using the IFs. The just set .Body = YourTextString
    If someone has helped you then please add to their Reputation

+ 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. HTML to Range -> OutApp: Outlook | Signature Issue
    By clprdctn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2014, 12:14 PM
  2. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  3. Where to add .SendUsingAccount = OutApp.Session.Accounts.Item(1)
    By aukhan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2013, 01:54 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  6. Set OutApp = CreateObject("Outlook.Application") - Runtime error 429
    By Buffyslay in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-29-2012, 09:44 AM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

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