AJS
10-04-2004, 05:39 PM
Hi,
I would like to be able to run a test on a range to see if it consists entirely of empty cells. My code is similar to below:
Sub TestRange()
Dim CheckRange As Range
Set CheckRange = Sheet1.Range("B2:B5")
If Not IsEmpty(CheckRange) Then
MsgBox "Range Not Empty"
Else
MsgBox "Range Empty"
End If
End Sub
I have also tried
If Not CheckRange is nothing Then
in place of the IsEmpty test. I am missing something here..
I would like to be able to run a test on a range to see if it consists entirely of empty cells. My code is similar to below:
Sub TestRange()
Dim CheckRange As Range
Set CheckRange = Sheet1.Range("B2:B5")
If Not IsEmpty(CheckRange) Then
MsgBox "Range Not Empty"
Else
MsgBox "Range Empty"
End If
End Sub
I have also tried
If Not CheckRange is nothing Then
in place of the IsEmpty test. I am missing something here..