What is the equivalent of "!=" in Excel VBA?
In VBA, the !=
operator is the Not
operator, like this:
If Not strTest = "" Then ...
Try to use <>
instead of !=
.
Just a note. If you want to compare a string with ""
,in your case, use
If LEN(str) > 0 Then
or even just
If LEN(str) Then
instead.
Because the inequality operator in VBA is <>
If strTest <> "" Then
.....
the operator !=
is used in C#, C++.