+ Reply to Thread
Results 1 to 9 of 9

need 2 if and then statement code

  1. #1
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    need 2 if and then statement code

    using:
    For Each
    If Then
    Else
    End If

    Can I have 2 if's? Examples:

    Please Login or Register  to view this content.
    Last edited by Cutter; 09-21-2012 at 10:14 PM. Reason: Added code tags

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: need 2 if and then statement code

    a little different approach

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: need 2 if and then statement code

    Hey Thanks for the quick reply.
    So with what I want, I can't use IF statement, I have to use case?

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: need 2 if and then statement code

    No you can use If. Its just my preference to use Select Case in cases like this

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: need 2 if and then statement code

    Ahhhhh this is what I'm looking for. So, it's 2 Else and not IF.
    Are there differences between else and elseif?
    Sorry, I'm a newbie and learning. My assignment is using If and Else. Also just one if and one else( Hi and lo). I just wanna know if I can do more (add middle).

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: need 2 if and then statement code

    Theres all different ways to get the same results

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: need 2 if and then statement code

    Getting better each time.
    I take my previous comment back. Thisssssss one is the one I really want.
    I did this but I guess I didn't add x3 end if. I thought one end if would cover them all.
    Thanks again.

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: need 2 if and then statement code

    @ EXLent

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at the top of the page and read Rule #3.
    Thanks.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  9. #9
    Forum Contributor
    Join Date
    09-05-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    209

    Re: need 2 if and then statement code

    understand fully. Tho Mike had answer my question, he keeps giving me more alternative and I was gonna wait and see any more trick up his sleeves before I thank and close the thread.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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