Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default What is the VBA code to delete a sheet without warning message?

I have the following code to delete a tab:

Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.Delete

When I run this, I get the standard "You may lose data" warning
message. Does a different syntax allow me to delete the sheet without
getting the warning message?

Thanks

  #2   Report Post  
Dennis
 
Posts: n/a
Default


Application.DisplayAlerts = False
Sheets("Your Sheet").Delete
Application.DisplayAlerts = True

HTH Dennis


" wrote:

I have the following code to delete a tab:

Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.Delete

When I run this, I get the standard "You may lose data" warning
message. Does a different syntax allow me to delete the sheet without
getting the warning message?

Thanks


  #3   Report Post  
 
Posts: n/a
Default

Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can we delete rows permanently from excel sheet Nehal Shah Excel Discussion (Misc queries) 1 August 1st 05 01:58 PM
is there anyway to make it so the users of my excel spread sheet cant view the macro code w/o a password? Daniel Excel Worksheet Functions 2 June 28th 05 05:34 AM
Highlighting gwenturpin Excel Discussion (Misc queries) 23 June 16th 05 04:28 PM
linking multiple sheets to a summary sheet greg g Excel Discussion (Misc queries) 1 December 16th 04 07:43 AM
how can i select all the cells with same color on a sheet if there are multipale colors by vba code uobt Charts and Charting in Excel 1 December 15th 04 05:27 PM


All times are GMT +1. The time now is 03:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"