Consulting

Results 1 to 3 of 3

Thread: Solved: Deleting Worksheets without OKing "Warning Message"

  1. #1

    Solved: Deleting Worksheets without OKing "Warning Message"

    Hi there,

    I've got a piece of code that deletes worksheets as follows

    [VBA]


    For x = 1 To Worksheets.Count - 1


    Sheets("Link " & x).Select
    ActiveWindow.SelectedSheets.Delete

    Next x


    [/VBA]

    When this deletes my sheets, it comes up with warning messages for each sheets: "Data may exist in the sheet(s) selected for....."

    Is there a way of bypassing this?

    Thanks in advance,

    Max

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [VBA]Application.DisplayAlerts = False[/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    Thanks!

Posting Permissions

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