Coding a function

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

In a function, I want to test if varAssn (string)
and it IS NOT between "01 and "28" set a variable
what is the proper code? thanks

If varAssn < "01" And varAssn > "28" Then X="ZZZ"
 
Junior said:
In a function, I want to test if varAssn (string)
and it IS NOT between "01 and "28" set a variable
what is the proper code? thanks

If varAssn < "01" And varAssn > "28" Then X="ZZZ"

A value could not be both less than "01" AND be greater than "28". You
need to use OR instead.
 
OK thanks -
So if i want to set a variable say X="Error"
whenever varAssn IS NOT between "01" and "28"
what would the code look like in a function.
 
Junior said:
OK thanks -
So if i want to set a variable say X="Error"
whenever varAssn IS NOT between "01" and "28"
what would the code look like in a function.

It would look exactly like what you posted in your original question except the
word "and" would be replaced with the word "or".
 
Back
Top