+ Reply to Thread
Results 1 to 4 of 4

Convuluted IF OR Syntax Puzzler

  1. #1
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Convuluted IF OR Syntax Puzzler

    Hi,

    I have 3 conditions that I just can't seem to set out properly in VBA. Wrap your puzzle solving brain around these:

    - basically 3 sets of 5 variables each

    At the end, one variable from each set must equal another variable from each set before proceeding.

    I get the first 5 (A,B,C,D,E) then get another 4 (F,G,H,I), make sure one of the second set = one of the first set, get a J or if not then J must = one from the first set, get the last 4 (K,L,M,N) and make sure one from the third set = one from the second set, get an O or if not make O = one from the second set and make sure one from the third set = one from the first set, go ahead or if not, get a new N until one from the second set = one from the third set .........I think.

    I have 15 simple variables DIM as Integer: A,B,C,D,E, F,G,H,I,J, K,L,M,N & O

    So I believe I have to say:

    if F,G,H or I aren't equal to A,B,C,D or E, J must be equal to A,B,C,D, or E
    else
    goto NEWJ
    end if

    if K,L,M or N aren't equal to A,B,C,D or E, O must be equal to A,B,C,D or E
    else
    goto NEWO
    end if

    if K,L,M, or N aren't equal to F,G,H,I or J, N must be equal to F,G,H,I or J
    else
    goto NEWN
    end if


    I'd ask Mr. Spock, but he's fictitious. I told Santa that and he slapped me in the face.

    any help is appreciated

    thanks
    Last edited by stockgoblin42; 09-06-2013 at 11:10 AM.
    live logic & long prosper

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Convuluted IF OR Syntax Puzzler

    try this. if it works, change it for the rest... sorry couldnt complete it as im typing off my phone.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Convuluted IF OR Syntax Puzzler

    Oh Oh,

    I have an additional problem.

    The 15 variables aren't derived from the same data set. There are two sets of data.

    A,B, F,G & K,L are from one data set

    C,D,E, H,I,J & M,N,O are from another data set

    this complicates things because A can = 2 and C can = 2 but they're not = as they're from different data sets.

    Hmmm, how am I going to deal with this too?

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Convuluted IF OR Syntax Puzzler

    ? Sorry I don't understand what you mean. Maybe posting workbook example or someone else could help.

+ 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. need help with VBA syntax
    By cbrf23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2011, 04:55 PM
  2. Quite a puzzler - Concatenate for unique entries
    By despacos in forum Excel General
    Replies: 2
    Last Post: 04-15-2011, 09:47 AM
  3. Quite a puzzler - Concatenate for unique entries
    By despacos in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-15-2011, 09:17 AM
  4. Here's a puzzler...!
    By red49er in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-08-2006, 06:57 AM
  5. [SOLVED] Pivot Table Question - a puzzler
    By bill_morgan in forum Excel General
    Replies: 1
    Last Post: 10-26-2005, 11:05 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