+ Reply to Thread
Results 1 to 3 of 3

If-Else or If-Then-Else - How to perform Either/And?

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Excel 2016
    Posts
    52

    If-Else or If-Then-Else - How to perform Either/And?

    I am struggling with what I think will be simple for an experienced VBA user.

    I have a worksheet in which Column A (Print) and Column B (Email) values are "Yes" or "No", and can be of any combination (No/No, No/Yes, Yes/No, or Yes/Yes). If the value of Column A is "Yes", a statement is printed to PDF. If the Value of Column B is "Yes", an email is to be sent. I am looking for guidance on how to structure the macro to address all of the four Yes/No combinations. If-Then? If-Then-Else?

    Thank you in advance!

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: If-Else or If-Then-Else - How to perform Either/And?

    You use the following construction:

    Please Login or Register  to view this content.
    The last Else will take care of any other condition, you can also use ElseIf instead so only if one of the conditions is met something happens.

    The other method is using Select Case

    Please Login or Register  to view this content.
    What you do have to keep in mind is these If or Case statements are case sensitive.

    Hope I've been able to push you in the right direction
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Minneapolis, Minnesota
    MS-Off Ver
    Excel 2016
    Posts
    52

    Re: If-Else or If-Then-Else - How to perform Either/And?

    I'll give it a go.

    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. Replies: 4
    Last Post: 11-30-2012, 03:14 PM
  2. [SOLVED] cant perform summation
    By romandotcom in forum Excel General
    Replies: 2
    Last Post: 11-28-2012, 06:05 AM
  3. PERFORM Averaging
    By Philangr8 in forum Excel General
    Replies: 5
    Last Post: 09-28-2010, 08:48 PM
  4. Perform 2 Operations as an AND
    By Matt12 in forum Excel General
    Replies: 2
    Last Post: 07-13-2008, 04:55 PM
  5. [SOLVED] perform 1 function, stop, perform different function
    By nastech in forum Excel General
    Replies: 0
    Last Post: 08-22-2006, 07:25 AM
  6. [SOLVED] perform SUMIF
    By Robert in forum Excel General
    Replies: 1
    Last Post: 05-12-2006, 10:10 AM
  7. [SOLVED] perform caculations on displayed value in Excel 2000-how can i perform
    By Amir in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  8. [SOLVED] perform:sum
    By Any in forum Excel General
    Replies: 2
    Last Post: 03-15-2005, 07:06 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