Dont want the deletion option

T

T De Villiers

When running the code I am given the option to delete, I dont require
this,
many thks

Sub reb()

Dim wks As Worksheet
Dim wkb As Workbook

For Each wks In ThisWorkbook.Worksheets
If wks.Name = "taz" Then
wks.Delete
End If
Next


End Sub
 
R

Ron de Bruin

Application.DisplayAlerts = False
wks.Delete
Application.DisplayAlerts = True

But without a loop you can use this

On Error Resume Next
Application.DisplayAlerts = False
Sheets("taz").Delete
Application.DisplayAlerts = True
On Error GoTo 0
 
A

ADG

Hi

Before Wks.delete add

Application.DisplayAlerts = False

then after add

Application.DisplayAlerts = True

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top