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

I had great help with my last problem from bpeltzer.

Here is my new problem.

I now want to delete some worksheets without Excel asking me if I really
want to do it. I am using the code below:

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

I want to do this automatically without having to click on the delete
dialogue box that appears.

Any ideas?

Thanks in advance,
Martin


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Deleting a worksheet

Place

Application.DisplayAlerts = False

prior to deleting the sheets.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Martin" wrote in message
...
I had great help with my last problem from bpeltzer.

Here is my new problem.

I now want to delete some worksheets without Excel asking me if
I really
want to do it. I am using the code below:

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

I want to do this automatically without having to click on the
delete
dialogue box that appears.

Any ideas?

Thanks in advance,
Martin




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Deleting a worksheet

Try

Application.DisplayAlerts = False
Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True

Jan

"Martin" skrev i en meddelelse
...
I had great help with my last problem from bpeltzer.

Here is my new problem.

I now want to delete some worksheets without Excel asking me if I really
want to do it. I am using the code below:

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

I want to do this automatically without having to click on the delete
dialogue box that appears.

Any ideas?

Thanks in advance,
Martin




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Deleting a worksheet

Hi Martin,

Try:

Sub Tester()
Application.DisplayAlerts = False
Sheets(Array("Sheet1", "Sheet2")).Delete
Application.DisplayAlerts = True
End Sub


---
Regards,
Norman



"Martin" wrote in message
...
I had great help with my last problem from bpeltzer.

Here is my new problem.

I now want to delete some worksheets without Excel asking me if I really
want to do it. I am using the code below:

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

I want to do this automatically without having to click on the delete
dialogue box that appears.

Any ideas?

Thanks in advance,
Martin




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Deleting a worksheet

Thanks a lot. It's easy when you know how - unfortunately I don't


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 of worksheet oldLearner57 Excel Discussion (Misc queries) 1 August 28th 08 06:31 AM
Deleting a worksheet but retaining values from the worksheet. [email protected] Excel Discussion (Misc queries) 1 September 13th 06 03:00 PM
Deleting a worksheet but retaining values from the worksheet. [email protected] Excel Discussion (Misc queries) 1 September 13th 06 02:48 PM
deleting values in a worksheet without deleting the formulas patti Excel Worksheet Functions 1 October 28th 05 09:49 PM
deleting worksheet Fun Kid Excel Programming 2 May 5th 04 11:22 PM


All times are GMT +1. The time now is 04:15 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"