Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Deleting A Worksheet - There may be data ...

In the course of a macro, i create a worksheet edit some data and then
transfer the data to another sheet. When i delete the worksheet using the
command

Sheets("Name").Delete

I am prompted that there may be data in the worksheet and asks for
confirmation that i want that sheet deleted. This occurs even if i delete
all the occupied cells in a sheet. How can i turn this prompt off?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Deleting A Worksheet - There may be data ...

Enclose your code in:

Application.DisplayAlerts = False

' your code

Application.DisplayAlerts = True

--
steveB

Remove "AYN" from email to respond
"Chaz" wrote in message
...
In the course of a macro, i create a worksheet edit some data and then
transfer the data to another sheet. When i delete the worksheet using the
command

Sheets("Name").Delete

I am prompted that there may be data in the worksheet and asks for
confirmation that i want that sheet deleted. This occurs even if i delete
all the occupied cells in a sheet. How can i turn this prompt off?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Deleting A Worksheet - There may be data ...

Use the following......

Application.DisplayAlerts = False

Sheets("Name").Delete

Application.DisplayAlerts = True

--
Cheers
Nigel



"Chaz" wrote in message
...
In the course of a macro, i create a worksheet edit some data and then
transfer the data to another sheet. When i delete the worksheet using the
command

Sheets("Name").Delete

I am prompted that there may be data in the worksheet and asks for
confirmation that i want that sheet deleted. This occurs even if i delete
all the occupied cells in a sheet. How can i turn this prompt off?

Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Deleting A Worksheet - There may be data ...

application.displayalerts=false
'do stuff
application.displayalerts=true

Tim


--
Tim Williams
Palo Alto, CA


"Chaz" wrote in message
...
In the course of a macro, i create a worksheet edit some data and then
transfer the data to another sheet. When i delete the worksheet using the
command

Sheets("Name").Delete

I am prompted that there may be data in the worksheet and asks for
confirmation that i want that sheet deleted. This occurs even if i delete
all the occupied cells in a sheet. How can i turn this prompt off?

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
Deleting cell data without deleting formula Tom Hall Excel Discussion (Misc queries) 4 October 29th 06 04:07 PM
Deleting a worksheet but retaining values from the worksheet. [email protected] Excel Discussion (Misc queries) 1 September 13th 06 03:00 PM
Deleting filtered out data from a worksheet Sierras Excel Worksheet Functions 2 January 20th 06 09:27 PM
deleting values in a worksheet without deleting the formulas patti Excel Worksheet Functions 1 October 28th 05 09:49 PM
how do I delete data from a worksheet without deleting the formul. Jack Excel Discussion (Misc queries) 1 February 17th 05 01:25 AM


All times are GMT +1. The time now is 10:09 PM.

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"