Results 1 to 7 of 7
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IF OR AND not work!!!! (2000 sr -1)

    If Sheets("L0953").Range("Q" + RIGA) = "S" Or Sheets("L0953").Range("S" + RIGA) = "C" And Sheets("L0953").Range("D" + RIGA) = MODIFICHE_USER.ComboBox1.Value And Sheets("L0953").Range("L" + RIGA) = MODIFICHE_USER.ComboBox2.Value Then

    riga = 3
    MODIFICHE_USER.ComboBox1.Value =146900090000
    MODIFICHE_USER.ComboBox2.Value =4500

    in this sheet the condition existis but not work!!!!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: IF OR AND not work!!!! (2000 sr -1)

    This?

    If (Sheets("L0953").Range("Q" & RIGA) = "S" Or Sheets("L0953").Range("S" & RIGA) = "C") And Sheets("L0953").Range("D" & RIGA) = MODIFICHE_USER.ComboBox1.Value And Sheets("L0953").Range("L" & RIGA) = MODIFICHE_USER.ComboBox2.Value Then

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF OR AND not work!!!! (2000 sr -1)

    Sorry but not intercept in other case??????

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: IF OR AND not work!!!! (2000 sr -1)

    Then you'll have to tell us exactly and clearly what you want to test for.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF OR AND not work!!!! (2000 sr -1)

    In column D and in column L first condition...
    and if exitis one of this condition ("S" or "C") in column Q or column column S

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: IF OR AND not work!!!! (2000 sr -1)

    The values of the combo boxes and of column D are text strings, but the value of column L is a number. Try

    If (Sheets("L0953").Range("Q" & RIGA) = "S" Or Sheets("L0953").Range("S" & RIGA) = "C") And Sheets("L0953").Range("D" & RIGA) = MODIFICHE_USER.ComboBox1.Value And Sheets("L0953").Range("L" & RIGA) = CLng(MODIFICHE_USER.ComboBox2.Value) Then

    CLng converts the text string to a number.

  7. #7
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF OR AND not work!!!! (2000 sr -1)

    Sorry me, i am stupid!
    Work now, as usual!
    Tks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •