Hi,
how can i check if worksheets labeled sheet2, sheet3 and sheet4 is
empty?
thanks
Hi,
how can i check if worksheets labeled sheet2, sheet3 and sheet4 is
empty?
thanks
One way
If Application.WorksheetFunction.CountA(sheets("Sheet2").Cells) = 0 Then
If 0 there is no data on the sheet
Here is a working example to delete empty sheets
Sub Delete_EmptySheets()
Dim sh As Worksheet 'Ron de Bruin, programming, 2002-12-28
'On Error Resume Next 'possibility of all sheets blank
For Each sh In ThisWorkbook.Worksheets
If Application.WorksheetFunction.CountA(sh.Cells) = 0 Then
Application.DisplayAlerts = False
sh.Delete
Application.DisplayAlerts = True
End If
Next
'On Error goto 0 'Excel must have one sheet/workbook
End Sub
--
Regards Ron de Bruin
http://www.rondebruin.nl
"Lynn" <moley_cruz@yahoo.com.au> wrote in message news:1129040925.060551.317060@g49g2000cwa.googlegroups.com...
> Hi,
> how can i check if worksheets labeled sheet2, sheet3 and sheet4 is
> empty?
> thanks
>
Hi there this is a super old thread but it solves my problem.
Instead of deleting each empty worksheet, how do I make it total the number of empty worksheets in my workbook and output
the data in a cell in worksheet named "Initial Analysis"
Thanks
Possibly...![]()
Please Login or Register to view this content.
Administrative Note:
We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.
Please see Forum Rule #4 about hijacking and start a new thread for your query.
If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
NB: as a Moderator, I never accept friendship requests.
Forum Rules (updated August 2023): please read them here.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks