Reputation: 25965
I've to execute a piece of code written in Visual Basic for Applications (VBA) when the excel cell is not empty. I've written below piece of code so far:
Public Sub BindTitles(ByVal cell As Range)
If IsEmpty(cell.Value) Then
Application.EnableEvents = False
'other code
End If
End Sub
I want to invert the logical condition present in If
statement. In C#, I use exclamation operator !
but when I put it in If
block it gives below error:
Compile error:
Invalid or unqualified reference
Upvotes: 0
Views: 2327
Reputation: 8508
The logical negation !
operator in VBA is Not
:
If Not IsEmpty(cell.Value) Then '...
Upvotes: 1