Jump to content
Sign in to follow this  
cheesestain

if statement not working

Recommended Posts

cheesestain

I can't seem to figure out why my if statement is not working. The error only comes up if both $ProductCodeReplaceLength and $ProductCodeSearchLength > 21 but not if $ProductCodeSearchLength > 21

If $ProductCodeSearchLength <= 20 Or $ProductCodeReplaceLength <= 20 Then
    For $a = $ProductCodeSearchLength to 19
     $ReadProductCodeSearchInput &= " "
    Next
    For $b = $ProductCodeReplaceLength to 19
     $ReadProductCodeReplaceInput &= " "
    Next
  
Else
    MsgBox(0,"Error","Error1")
   EndIf

Share this post


Link to post
Share on other sites
cheesestain

Thanks! It worked.

Little confused though. I thought And meant that both conditions had to be met and that Or meant only one.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×