This is my macro:
Sub Macro()
Dim rng As Range
Set rng = Range("B1:B5")
If IsEmpty(rng.Value) = False Then
MsgBox "Run Macro"
Else
MsgBox "Cells are Empty"
End If
End Sub
But when the cells are empty, instead of getting "Cell are empty" i get "Run Macro". When cells have contents, I get "Cells are empty".
If I change it to IsEmpty = True, the opposite of my intended result still happens.
Why?
Sub Macro()
Dim rng As Range
Set rng = Range("B1:B5")
If IsEmpty(rng.Value) = False Then
MsgBox "Run Macro"
Else
MsgBox "Cells are Empty"
End If
End Sub
But when the cells are empty, instead of getting "Cell are empty" i get "Run Macro". When cells have contents, I get "Cells are empty".
If I change it to IsEmpty = True, the opposite of my intended result still happens.
Why?