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

    trapping var (2000 sr-1)

    Assuming i have my_var it can filled with "00", "02". "77" ecc... to "99"

    Thi s my_var is possible is filled with "xx" in this case i nwould want:
    ........
    If my_var is filled with a value not in range "00" to "99"
    then
    my macro00
    else
    call my macro01
    end if
    .......

    my idea is to use an arrry into code similar: my array 00 to 99

    hope i am clear...

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

    Re: trapping var (2000 sr-1)

    I don't understand why you would need an array - as far as I can see, you have a single value.

    Will the value of my_var always be a number or could it be text too, such as "Sal" or "Imparato"?

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: trapping var (2000 sr-1)

    Hi Sal

    As Hans states why not

    If my_var > 99 then

    ....do something

    else

    ...do something different

    end if

    ...
    Jerry

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

    Re: trapping var (2000 sr-1)

    ... the variable it can assume the value from 00 to 99 (00, 01,78,89...99) or xx or .1 xy but end if not is into this range...from 00 to 99 ecc...
    edn if not is into this range ecc...

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

    Re: trapping var (2000 sr-1)

    hi jerry...
    But sure if the var assume yx your code work?

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

    Re: trapping var (2000 sr-1)

    Sorry, this is incomprehensible. Please try to explain more clearly.

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

    Re: trapping var (2000 sr-1)

    my_var = xx (not in range from 00 t0 99) thne call my_macro00 else is range (00...99) call my_nacro_01

    in effect consider my range value are in:
    00
    01
    02
    03
    04
    ....
    97
    98
    99

    end permission

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

    Re: trapping var (2000 sr-1)

    But what are the possible values that do NOT satisfy the condition? Are they always numeric, such as -29 or 124, or can they also be text values such as "Woody"?

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

    Re: trapping var (2000 sr-1)

    my var is filled max with two character...

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

    Re: trapping var (2000 sr-1)

    in effect if my_var not is in range from 00 to 99 is a wrong value...

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

    Re: trapping var (2000 sr-1)

    numeric with max two character...

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

    Re: trapping var (2000 sr-1)

    Try

    If my_var < "00" Or my_var > "99" Then
    Call macro00
    Else
    Call macro01
    End If

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

    Re: trapping var (2000 sr-1)

    Hans sorry for my english but this code sure work i have see nad you understand now my Napoplitan/english/italian...:-)
    I tst toowmorrow in my offcie not have the wbook in my home!

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

    Re: trapping var (2000 sr-1)

    Naturally my english is terrible....
    But You understand ...
    Work perfect!
    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
  •