+ Reply to Thread
Results 1 to 4 of 4

vba email send from excel - ignore second email address if "ENTER EMAIL ADDRESS"

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    vba email send from excel - ignore second email address if "ENTER EMAIL ADDRESS"

    I am using the below code to email a worksheet from a macro using email addresses in cells chosen from a dropdrown list. The last cell reference is to allow the user to enter email address not available on the dropdown lists, an "ad hoc" address that the code then changes the cell entry back to "ENTER EMAIL ADDRESS".

    I would like the macro to test the value of cell [f14] and if "ENTER EMAIL ADDRESS" ignore and do not add to the recipient list along with cell [I6]
    Please Login or Register  to view this content.
    any assistance appreciated. Rgds....
    Last edited by nigelog; 09-28-2016 at 05:07 AM.

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: vba email send from excel - ignore second email address if "ENTER EMAIL ADDRESS"

    Please Login or Register  to view this content.
    longwinded way of doing it but does the job....

  3. #3
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: vba email send from excel - ignore second email address if "ENTER EMAIL ADDRESS"

    Assign the first email address to the field including the semi-colon separator; then, if the second cell contains a valid email address, append that to the 'To' field. Alternatively use an inline IIF() function to check the value of the second.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    IF (or the Inline version, IIF()) is the most basic of VBA control structures - Something you need to know, and there's absolutely no need for the 'long winded' version.
    Last edited by cytop; 09-28-2016 at 07:41 AM. Reason: TYpo

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: vba email send from excel - ignore second email address if "ENTER EMAIL ADDRESS"

    Thank You Cytop, much neater....will look up IIF function now

+ 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. [SOLVED] VBA to send email using data from the EXCEL including email address, subject and body text
    By ec4excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2016, 11:07 AM
  2. rule to send an email alert to another email address
    By wayneg in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 02-08-2016, 06:15 PM
  3. Send an email via outlook from and address other than your default email.
    By sungen99 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-28-2015, 06:15 PM
  4. [SOLVED] Send email as To address to all email id stored in excel
    By santbiju1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-05-2015, 03:03 AM
  5. VBA code to send email to the people whose email address is in the Access table
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2014, 05:11 AM
  6. Email workbook to email address in cell "a1" macro
    By klawlor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2013, 09:20 AM
  7. Replies: 6
    Last Post: 12-02-2011, 02:14 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