Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if worksheet is empty
Hi,
how can i check if worksheets labeled sheet2, sheet3 and sheet4 is empty? thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
check if worksheet is empty
One way
If Application.WorksheetFunction.CountA(sheets("Sheet 2").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" wrote in message oups.com... Hi, how can i check if worksheets labeled sheet2, sheet3 and sheet4 is empty? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check for empty range in vba | Excel Discussion (Misc queries) | |||
Check if Active Workbook is Empty | Excel Programming | |||
Check if empty | Excel Programming | |||
How to check for next empty cell in list | Excel Programming | |||
vba - check if cell is empty | Excel Programming |