PC Review


Reply
Thread Tools Rate Thread

Deleting a sheet with VBA

 
 
hamishd
Guest
Posts: n/a
 
      25th Nov 2008
Hi, i'm using the line:
Sheets("Sheet2").Delete

However, on execution, I get a warning messagebox:
"Data may exist in the sheet(s) selected for deletion. To permanently
delete the data, press Delete."

How do I suppress messages of these types?

Thanks.
 
Reply With Quote
 
 
 
 
Gary Keramidas
Guest
Posts: n/a
 
      25th Nov 2008
and if you set it to false, make sure you always set it back to true

Application.DisplayAlerts = False
Sheets("Sheet2").Delete
Application.DisplayAlerts = True

--


Gary

"hamishd" <(E-Mail Removed)> wrote in message
news:660c4f19-df0b-4ff1-a2cb-(E-Mail Removed)...
> Hi, i'm using the line:
> Sheets("Sheet2").Delete
>
> However, on execution, I get a warning messagebox:
> "Data may exist in the sheet(s) selected for deletion. To permanently
> delete the data, press Delete."
>
> How do I suppress messages of these types?
>
> Thanks.



 
Reply With Quote
 
RadarEye
Guest
Posts: n/a
 
      25th Nov 2008
Hi,

Try:

Application.DisplayAlerts = False
Sheets("Sheet2").Delete
Application.DisplayAlerts = True

HTH,

Wouter
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting sheet Seeker Microsoft Excel Programming 4 7th Jun 2009 12:09 PM
Deleting a sheet with the same name LabrGuy Bob R Microsoft Excel Programming 9 5th Oct 2007 11:42 PM
deleting rows from one sheet based on 2nd sheet =?Utf-8?B?bWFnb2xkMjAwNUBob3RtYWlsLmNvbQ==?= Microsoft Excel Discussion 1 6th Sep 2007 07:38 AM
Deleting sheet Brandi Microsoft Excel Programming 2 7th Oct 2004 09:31 PM
Deleting a Sheet Abdul Salam Microsoft Excel Programming 1 29th Jul 2003 12:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:00 PM.