Checking if worksheet is blank

T

Tommi

Hello!

I would like to know if there is a neat way to check if worksheet is totally
blank. Of course I could go through every cell and check its contents but is
there easier way?

BR,
Tommi
 
T

Tom Ogilvy

If isempty(Range("A1")) and ActiveSheet.UsedRange.count = 1 then

or

if Application.countA(Activesheet.cells) = 0 then

You may get different answers - if you mean an entry in any cell, then use
the latter.
 
J

J.E. McGimpsey

one way:

Dim blank As Boolean
blank = Application.CountA(Worksheets("Sheet1").Cells) = 0
 
A

Alan Webb

Might this do the trick for you?

Function BlankSheet() As Boolean
BlankSheet = False
If ActiveSheet.UsedRange.Address = "$A$1" Then
If Len(Trim(ActiveSheet.UsedRange)) = 0 Then
BlankSheet = True
End If
End If
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top