+ Reply to Thread
Results 1 to 4 of 4

If Then statements with multiple Then actions to take.

  1. #1
    Registered User
    Join Date
    11-02-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    If Then statements with multiple Then actions to take.

    I am trying to run the following code but keep getting "Compile Error: End If with Block If" with the second "End If" being highlighted.
    I am guessing it is because I am trying to take several actions vice a single action. First day using If Then Statements. Thanks.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: If Then statements with multiple Then actions to take.

    Hi

    Try

    Get rid of the _ after the Then statements.
    make N / A ==> "N / A"
    What is the variable u? You have used it as I presume a string when doing the If test, but then you have it as a string that can be turned into a range address, so I don't see how they can be compatible.

    rylo

  3. #3
    Registered User
    Join Date
    11-02-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: If Then statements with multiple Then actions to take.

    rylo,

    Thanks, it was just a type. it was supposed to say "If y =", not u.

    I tried the "N/A" though, and I cant get it to insert. I have then changed it to the code below. It just leave the target cell blank. Any ideas?
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-02-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: If Then statements with multiple Then actions to take.

    rylo,

    Never mind. I got it. Really, thanks for catching the "u". I'm on about hour 13 staring at this code today, and that one just slipped by me.

+ 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