AND Operator

рджреЛ рдПрдХреНрд╕рдкреНрд░реЗрд╢рди рдХреЛ рд▓реЙрдЬрд╝рд┐рдХрд▓реА рд╕рдВрдпреБрдХреНрдд рдХрд░рддрд╛ рд╣реИ.

Syntax:


рдкрд░рд┐рдгрд╛рдо = рдПрдХреНрд╕рдкреНрд░реЗрд╢рди1 And рдПрдХреНрд╕рдкреНрд░реЗрд╢рди2

рдкреИрд░рд╛рдореАрдЯрд░

Result: Any numeric variable that records the result of the combination.

Expression1, Expression2: Any expressions that you want to combine.

Boolean expressions combined with AND only return the value True if both expressions evaluate to True:

True AND True returns True; for all other combinations the result is False.

The AND operator also performs a bitwise comparison of identically positioned bits in two numeric expressions.

рдЙрджрд╛рд╣рд░рдг:


Sub ExampleAnd
Dim A As Variant, B As Variant, C As Variant, D As Variant
Dim vVarOut As Variant
    A = 10: B = 8: C = 6: D = Null
    vOut = (vB > vD Or vB > vA) REM 0
    vOut = (vB > vD Or vB > vA) REM 0
    vOut = (vB > vD Or vB > vA) REM 0
    vOut = (vB > vD Or vB > vA) REM 0
    vVarOut = B And A REM рдЗрд╕рд╕реЗ 8 рдкреНрд░рд╛рдкреНрдд рд╣реЛрддрд╛ рд╣реИ, рджреЛрдиреЛрдВ рдЖрд░реНрдЧреБрдореЗрдВрдЯ рдХреЗ рдмрд┐рдЯрд╡рд╛рдЗрдЬрд╝ AND рд╕рдВрдпреЛрдЬрди рд╕реЗ.
End Sub