Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check if Active Workbook is Empty


Excel 2003 with Visual Basic 6.3

I'm sure there must be a way to check and see if the Active Workbook is
empty.

Any clues?


--
scantor145
------------------------------------------------------------------------
scantor145's Profile: http://www.excelforum.com/member.php...o&userid=14766
View this thread: http://www.excelforum.com/showthread...hreadid=390186

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Check if Active Workbook is Empty

What is your definition of empy?

Possibly

Dim bEmpty as Boolean, sh as Worksheet
bEmpty = True
for each sh in Activeworkbook.Worksheets
if Application.CountA(sh.UsedRange) < 0 then
bEmpty = False
Exit for
end if
Next
With ActiveWorkbook
if .Worksheets.count < .Sheets.count then _
bEmpty = False
End With
if bEmpty then
msgbox Activeworkbook.Name & " is empty"
end if

The above doesn't check for shapes/olebojects or code.

--
Regards,
Tom Ogilvy

"scantor145" wrote
in message ...

Excel 2003 with Visual Basic 6.3

I'm sure there must be a way to check and see if the Active Workbook is
empty.

Any clues?


--
scantor145
------------------------------------------------------------------------
scantor145's Profile:

http://www.excelforum.com/member.php...o&userid=14766
View this thread: http://www.excelforum.com/showthread...hreadid=390186



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
how to know the active column is empty ? pol Excel Discussion (Misc queries) 3 February 24th 10 03:41 PM
Can I keep "Windows of active workbook check box" checked SueH Excel Discussion (Misc queries) 1 February 15th 07 07:38 PM
macro- move down to empty cell & active worksheet EducatingMom Excel Worksheet Functions 3 August 4th 06 11:02 PM
Check active sheet not the one with macros Oscar Excel Programming 2 July 30th 04 04:32 PM
Code to check for active worksheet KimberlyC Excel Programming 2 November 5th 03 02:49 AM


All times are GMT +1. The time now is 12:32 AM.

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

About Us

"It's about Microsoft Excel"