Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Sheets
Hi Does anyone have any suggestions for deleting an entire sheet in workbook if Cell A1 in the Sheet is blank? Thank -- STEVE ----------------------------------------------------------------------- STEVEB's Profile: http://www.excelforum.com/member.php...nfo&userid=187 View this thread: http://www.excelforum.com/showthread.php?threadid=50679 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Sheets
Try
If Range("A1").Value = "" Then Application.DisplayAlerts = False Worksheets("Sheet1").Delete Application.DisplayAlerts = True End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "STEVEB" wrote in message ... Hi Does anyone have any suggestions for deleting an entire sheet in a workbook if Cell A1 in the Sheet is blank? Thanks -- STEVEB ------------------------------------------------------------------------ STEVEB's Profile: http://www.excelforum.com/member.php...fo&userid=1872 View this thread: http://www.excelforum.com/showthread...hreadid=506797 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Sheets
Sub DelSheet()
Dim wb As Workbook Dim ws As Worksheet Dim a As Variant Set wb = ActiveWorkbook Set ws = wb.Worksheets("sheet1") a = Range("A1").Value 'Put this in a for loop to change wb or ws as necessary If a = "" Then ws.Delete Else Set ws = wb.Worksheets("sheet2") End If End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Sheets
"STEVEB" wrote in
message ... One more way: --------------------------------- Sub Button14_Click() Application.DisplayAlerts = False If IsEmpty([Sheet7!A1]) Then Sheets("Sheet7").Delete End If End Sub ------------------------------ Bruno |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Sheets
Thanks everyone, Everything worked great! I appreciate your help -- STEVE ----------------------------------------------------------------------- STEVEB's Profile: http://www.excelforum.com/member.php...nfo&userid=187 View this thread: http://www.excelforum.com/showthread.php?threadid=50679 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming | |||
Macro to delete sheets and saves remaining file does not properly delete module | Excel Programming |