Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Checking if worksheet is blank

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Checking if worksheet is blank

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.

--
Regards,
Tom Ogilvy


"Tommi" wrote in message
...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Checking if worksheet is blank

one way:

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


In article ,
"Tommi" wrote:

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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Checking if worksheet is blank

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking for the existence of a worksheet Allen Excel Discussion (Misc queries) 1 January 20th 10 06:57 PM
IS BLANK checking 2 Cells MKuria Excel Worksheet Functions 6 March 6th 09 07:31 PM
checking for blank cells when using vlookup Koomba Excel Worksheet Functions 1 September 27th 08 03:30 AM
Checking for exsitence of values in a different worksheet Dirk_Bob Excel Discussion (Misc queries) 2 September 28th 06 10:45 PM
Checking Blank Cells Karlos Excel Worksheet Functions 2 February 27th 06 12:34 PM


All times are GMT +1. The time now is 02:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"