+ Reply to Thread
Results 1 to 5 of 5

Proper syntax for an If statement with OR

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    Tolland, CT
    MS-Off Ver
    Excel 2007
    Posts
    37

    Proper syntax for an If statement with OR

    Trying to reference the same row and column as selected cell in Sheet2 and output if it contains certain values:

    Please Login or Register  to view this content.
    Anyone know what I'm doing wrong here?
    I feel like I'm just not understanding some syntax.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: If Statement Help

    Try this

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 06-26-2012 at 09:34 AM.
    HTH
    Regards, Jeff

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Proper syntax for an If statement with OR

    Please Login or Register  to view this content.



  4. #4
    Registered User
    Join Date
    06-21-2012
    Location
    Tolland, CT
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: If Statement Help

    Quote Originally Posted by jeffreybrown View Post
    Try this

    Please Login or Register  to view this content.
    This was perfect i have a lot of references to do in this vba program and I had no Idea about the with WS statement!

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Proper syntax for an If statement with OR

    Just a way to cut down on repetitive references, but also take a moment to check out what snb has to offer. He really knows how to cut down on the repetitve statements within a procedure.

    Glad it worked out for you, thanks for the feedback and marking the thread as solved

+ 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