+ Reply to Thread
Results 1 to 4 of 4

Dont want the deletion option

  1. #1
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    171

    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

  2. #2
    Ron de Bruin
    Guest

    Re: 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" <[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
    >




  3. #3
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    171
    Thanks Ron, works a treat

  4. #4
    ADG
    Guest

    RE: 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
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1