I have an Excel VBA formula:-
If [G56] = "Not Applicable" Then
...
It is case-sensitive. I want it to ignore the case of "Not applicable".
You can just use the LCase function:
If LCase([G56]) = "not applicable" Then
You can also use the dedicated function for comparing strings:
Dim result As Integer
'// vbTextCompare does a case-insensitive comparison
result = StrComp("Not Applicable", "NOT APPLICABLE", vbTextCompare)
If result = 0 Then
'// text matches
End If
There is some more information on the StrCompare
method in this MSDN article
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With