+ Reply to Thread
Results 1 to 7 of 7

only send attachment marked with "x" in column D2

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    only send attachment marked with "x" in column D2

    In the VB below I can not seem to add a line that will send an attachment only if cell D2 is marked with an "x". I think a statement needs to be in the section in bold but I am not sure the correct syntax. Thank you .

    VB
    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: only send attachment marked with "x" in column D2

    If c.Offset(, 3) = "x" Then
    This should test if column D has an "x" but it is case sensitive. If column D has a capital X, it's not a match.

    This should be case insensitive.
    If LCase(c.Offset(, 3)) = "x" Then

    Otherwise, I don't see a problem with your syntax.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: only send attachment marked with "x" in column D2

    I made the change, however the email only sends now when D2 is marked with an "x". If C2 is marked with an "x" the email still needs to get sent just with no attachment. Thank you .

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: only send attachment marked with "x" in column D2

    Quote Originally Posted by cmccabe View Post
    I made the change, however the email only sends now when D2 is marked with an "x". If C2 is marked with an "x" the email still needs to get sent just with no attachment. Thank you .
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 10-21-2015 at 12:05 PM.

  5. #5
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: only send attachment marked with "x" in column D2

    That works great, last question if C2 is marked with an "x" is it possible to not have the attachment file opened at all? Thank you .

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: only send attachment marked with "x" in column D2

    You don't need to open the attachment file regardless if you attach it to the email or not. So just keep it closed unless you need to change something in the file.

  7. #7
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: only send attachment marked with "x" in column D2

    Thank you .

+ 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. Disabling or interrupting "send email attachment" in excel 2010
    By andrewgarcia86 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2013, 02:14 PM
  2. Managing "delegated tasks" in an Outlook "Send Only" account
    By on_way_to_fame in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 08-13-2013, 12:21 AM
  3. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  4. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  5. Excel Template using "send to" as attachment
    By Dreammy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-28-2007, 05:50 PM
  6. how to add "send as attachment" to send to menu
    By vikkam in forum Excel General
    Replies: 1
    Last Post: 06-12-2007, 06:01 PM
  7. create links to check boxes marked "good" fair"and "bad"
    By pjb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-19-2006, 09:25 PM
  8. Replies: 1
    Last Post: 06-23-2005, 05:05 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