Answers for "vba ignore case"

VBA
1

vba Remove Case Sensitivity

'Removes case sensitivity
Option Compare Text
'Adds case sensitivity
Option Compare Binary
'Compare
debug.print StrComp(string1, string2, vbUseCompareOption) 'with choosen option
debug.print StrComp(string1, string2, vbBinaryCompare)	  'case sensitive
debug.print StrComp(string1, string2, vbTextCompare)      'case insensitive
Posted by: Guest on January-23-2021
12

excel vba Case-Insensitive String Comparison

MsgBox LCase(str1) = LCase(str2)


'Another option is to use vbTextCompare with the VBA StrComp() function:

MsgBox 0 = StrComp(str1, str2, vbTextCompare)

StrComp() will return -1 if str1 is less than str2.
StrComp() will return  0 if str1 is equal to str2.
StrComp() will return  1 if str1 is greater than str2.

'The above StrComp() examples are for when the optional 3rd argument
'is given as vbTextCompare. This results in a case-insensitive comparison.

'However, the StrComp() function defaults to vbBinaryCompare which
'results in case-SENSITVE comparisons.
'
'
'
Posted by: Guest on March-25-2020
3

vba ignore case

'Removes case sensitivity
Option Compare Text			' a < B
'Adds case sensitivity
Option Compare Binary		' A < B < a < b
'Compare
Debug.Print StrComp(string1, string2, vbUseCompareOption) 'Microsoft Access only
Debug.Print StrComp(string1, string2, vbBinaryCompare)	  'case sensitive
Debug.Print StrComp(string1, string2, vbTextCompare)      'case insensitive
Posted by: Guest on January-23-2021

Code answers related to "VBA"

Browse Popular Code Answers by Language