Skip to main content

Worksheet.Delete method

Deletes the object.

Syntax

expression.Delete

expression A variable that represents a Worksheet object.

Return value

Boolean

Remarks

When you delete a Worksheet object, this method displays a dialog box that prompts the user to confirm the deletion. This dialog box is displayed by default. When called on the Worksheet object, the Delete method returns a Boolean value that is False if the user chose Cancel on the dialog box, or True if the user chose Delete.

To delete a worksheet without displaying a dialog box, set the Application.DisplayAlerts property to False.

Examples

Excel Macro: Delete All Worksheets Except Active One

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>