+ Reply to Thread
Results 1 to 3 of 3

If Then statement embedded in my Email Code

  1. #1
    Registered User
    Join Date
    05-21-2019
    Location
    US
    MS-Off Ver
    Excel
    Posts
    1

    Question If Then statement embedded in my Email Code

    Hey all, I'm trying to add an if then statement into my Email code. The if then statement is this:

    Please Login or Register  to view this content.
    Pretty much I want the Email code to run the if then before populating the email to remove information that is not needed, but I keep getting errors. Any ideas would be much appreciated!

    Thanks
    Last edited by AliGW; 05-28-2019 at 05:03 PM.

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: If Then statement embedded in my Email Code

    The email code works until you add in the if/then statements? Where are you adding them? What error do you get?

    A quick glance shows the use of Sheet2.xxxx. I think that only works if Sheet2 is active, but then you would get errors in execution beyond the if/then statements. It would be better to use Sheets("Sheet2").xxxx
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: If Then statement embedded in my Email Code

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new here, I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Attaching an embedded PDF file in my worksheet to a new email
    By AnthonyGFS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2017, 04:24 AM
  2. Reading the text embedded in an email icon
    By soranz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2015, 11:26 PM
  3. send an email with logo embedded
    By melody10 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-10-2014, 11:38 AM
  4. Create a new column with company name which is embedded in email name
    By ajang in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-13-2014, 01:10 AM
  5. Add embedded picture to email
    By Swift4Play in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2011, 01:45 PM
  6. Embedded eMail Hyperlink
    By dumbnut in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-24-2010, 12:11 PM
  7. [SOLVED] Need help with an embedded IF statement
    By Lari in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-17-2006, 12:10 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