Depends on what you are testing.
Range object or cell value?
Sub test() Dim rngObject As Range Dim value As Variant Set rngObject = Sheet1.Range("A1:D5") If Not rngObject Is Nothing Then 'If not nothing then run this code End If value = rngObject.Cells(1, 1).value If Not IsEmpty(value) Then 'if Not empty then run this code End If If value <> vbNullString Then 'if value is not nullstring then run this code End If End Sub
source share