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

I know this is an easy one but I need some help.
I'd like to delete a sheet in my macro but I keep getting a dialog box that
asks me if I'm sure I want to delete the sheet. I want to bypass this
automatically but don't know how. Any help is appreciated.
Example of the 2 lines I'm stuck on.

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

I'm using Excel 97.

Thanks Kathy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default macro to delete a sheet

one way:

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

Note that you don't have to select the sheet first.

In article ,
"MoiraGunn" wrote:

I know this is an easy one but I need some help.
I'd like to delete a sheet in my macro but I keep getting a dialog box that
asks me if I'm sure I want to delete the sheet. I want to bypass this
automatically but don't know how. Any help is appreciated.
Example of the 2 lines I'm stuck on.

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

I'm using Excel 97.

Thanks Kathy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default macro to delete a sheet

Excellent - this works! Thanks very much -

"J.E. McGimpsey" wrote in message
...
one way:

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

Note that you don't have to select the sheet first.

In article ,
"MoiraGunn" wrote:

I know this is an easy one but I need some help.
I'd like to delete a sheet in my macro but I keep getting a dialog box

that
asks me if I'm sure I want to delete the sheet. I want to bypass this
automatically but don't know how. Any help is appreciated.
Example of the 2 lines I'm stuck on.

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

I'm using Excel 97.

Thanks Kathy




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
Delete values in sheet 2 that arre found in sheet 1 np Excel Discussion (Misc queries) 1 December 10th 09 07:21 PM
Macro to copy values then delete row for entire sheet Pyrotoy New Users to Excel 18 December 9th 08 12:43 AM
How can I delete a macro when the Delete button is not active? FCR Excel Worksheet Functions 0 March 9th 06 09:43 AM
Macro for sheet delete, very easy comotoman Excel Discussion (Misc queries) 1 October 11th 05 11:19 PM
How do i delete a macro in Excel 2003 when delete isn't highlight Abel Excel Discussion (Misc queries) 2 September 13th 05 04:09 AM


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