Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Deleting a sheet with VBA

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Deleting a sheet with VBA

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" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Deleting a sheet with VBA

Hi,

Try:

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

HTH,

Wouter
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
VBA for deleting a sheet Mike Excel Programming 3 November 22nd 05 08:02 PM
Deleting a sheet Kjeldc Excel Programming 1 August 9th 05 02:25 PM
Deleting a sheet P. Dileepan[_2_] Excel Programming 3 April 12th 04 10:34 AM
Deleting Sheet Tommi[_2_] Excel Programming 3 December 18th 03 05:28 PM
Deleting a Sheet Abdul Salam Excel Programming 1 July 29th 03 12:43 AM


All times are GMT +1. The time now is 04:44 AM.

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

About Us

"It's about Microsoft Excel"