ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dont want the deletion option (https://www.excelbanter.com/excel-programming/368179-dont-want-deletion-option.html)

T De Villiers[_55_]

Dont want the deletion option
 

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


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=564422


Ron de Bruin

Dont want the deletion option
 
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

--
Regards Ron de Bruin
http://www.rondebruin.nl



"T De Villiers" wrote in message
news:T.De.Villiers.2bgqxv_1153767309.8944@excelfor um-nospam.com...

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


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=564422




ADG

Dont want the deletion option
 
Hi

Before Wks.delete add

Application.DisplayAlerts = False

then after add

Application.DisplayAlerts = True

Regards
--
Tony Green


"T De Villiers" wrote:


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


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=564422



T De Villiers[_56_]

Dont want the deletion option
 

Thanks Ron, works a treat


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=564422



All times are GMT +1. The time now is 07:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com