When you looked at comparison operators in the last chapter, the operands you used were simple numbers and strings. Indeed, most of the comparison operators don't make sense in the context of objects (for example, it's absurd to think of one object being "greater than" another). However, VBA does have a comparison operator specifically for objects ”the Is operator:
result = Object1 Is Object2
When you want to specify colors in VBA, use the RGB function:
RGB(red, green, blue)
red
An integer value between 0 and 255 that represents the red component of the color .
green
An integer value between 0 and 255 that represents the green component of the color.
blue
An integer value between 0 and 255 that represents the blue component of the color.
Here, Object1 and Object2 are objects or Object variables . If they're the same, result takes the value True; otherwise , result is False.