ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with IsEmpty (https://www.excelbanter.com/excel-programming/290874-help-isempty.html)

FRED

Help with IsEmpty
 
I have a range named "seabassrange" which consists of two nonadjacent rows by ten columns. I want to check the range to ensure there is nothing in it prior to proceeding. The test code below works when the range is only one cell, but when I try to apply it to my desired range, it always tells me there is something in the range, even after I have deleted everything.

1. Could some kind of formatting be at play here
2. Is there another way to accomplish my goal

Thank you in advance
Fre

Sub test(
If IsEmpty("SeabassRange") The
MsgBox "empty
Els
MsgBox "not empty
End I
End Sub

Tom Ogilvy

Help with IsEmpty
 
Actually, your code doesn't work with a single area range. It is only
checking the top first cell.

If application.CountA("seabassrang") = 0 then

--
Regards,
Tom Ogilvy




"Fred" wrote in message
...
I have a range named "seabassrange" which consists of two nonadjacent rows

by ten columns. I want to check the range to ensure there is nothing in it
prior to proceeding. The test code below works when the range is only one
cell, but when I try to apply it to my desired range, it always tells me
there is something in the range, even after I have deleted everything.

1. Could some kind of formatting be at play here?
2. Is there another way to accomplish my goal?

Thank you in advance,
Fred

Sub test()
If IsEmpty("SeabassRange") Then
MsgBox "empty"
Else
MsgBox "not empty"
End If
End Sub





All times are GMT +1. The time now is 10:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com