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?
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?
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" <scantor145.1ss5iz_1122387046.7544@excelforum-nospam.com> wrote
in message news:scantor145.1ss5iz_1122387046.7544@excelforum-nospam.com...
>
> 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
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks