By using expertatexcel.com you agree to our cookie policy, We and our partners operate globally and use cookies, for multiple purposes

expertatexcel.com

 


Option Compare Text

This option statement at the top of a module is used to force all comparisons to be done regardless of case.



To do the same test without Option Compare Text

Immediate Window


? lcase("abc") = lcase("ABC")

True




This can be useful as the upper/lower case error is one of the most common errors you'll run into.

On the downside your code could break if you copy it somewhere and don't include this statement.

see also:
  • VBA Option Compare Text

  •