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
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
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" <[email protected]> wrote in message
news:[email protected]...
>
> 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
>
Thanks Ron, works a treat
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
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks