If we compare text in VBA Code then “B” is not equal to “b” since there ASCII codes for both these characters are different. However we can force Excel code to compare text on the basis of Text not on their Binary values.
Make use of Option Compare Text on the very First line of the Code module. It will force VBA to compare Text in Text mode not in Binary mode. By Default Text comparison is done in Binary mode.
If we don’t use Option Compare Text then
“B”<>”b”
If we make use of Option Compare Text then
“B”=”b”
Happy Coding…