Visual Basic for Applications Reference

Option Compare Statement Example

This example uses the Option Compare statement to set the default string comparison method. The Option Compare statement is used at the module level only.

  ' Set the string comparison method to Binary.
Option compare Binary    ' That is, "AAA" is less than "aaa".
' Set the string comparison method to Text.
Option compare Text   ' That is, "AAA" is equal to "aaa".