+ Reply to Thread
Results 1 to 4 of 4

If Then statements

  1. #1
    Registered User
    Join Date
    08-18-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    11

    If Then statements

    I have:
    60
    50
    40
    87
    68
    98
    90
    97
    20
    1
    entered in A1:A10

    This is my code:

    Please Login or Register  to view this content.

    it assigns all of these grades as failed...what's wrong here?
    Last edited by Leith Ross; 08-18-2011 at 08:25 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Noob question. (if then statements)

    Hello Nebular,

    You are applying worksheet formula thinking to VBA code. In VBA you need to test each cell using a loop. Here is the corrected code...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    08-05-2011
    Location
    İstanbul,Turkey
    MS-Off Ver
    Excel 2003
    Posts
    2

    Wink Re: If Then statements

    Hello ,another fix with "if then"

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-18-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: If Then statements

    Quote Originally Posted by mesuttasar View Post
    Hello ,another fix with "if then"

    Please Login or Register  to view this content.
    Thank you, both work, but I like this one better.

+ 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