Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default avoid warning when removing sheet

I want to remove all sheets except of sheet 1 by a macro

iSheetMax = Sheets.Count

' Delete other sheets
For iSheet = 2 To iSheetMax
Sheets(2 + iSheetMax - iSheet).Delete
Next

Then the user gets a warning message (warns for permanently deleting of
sheet).
I do not want this.

How can I prevent the warning message to appear?

Thanks,

Tijmen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default avoid warning when removing sheet


like this I suppose:

iSheetMax = Sheets.Count

' Delete other sheets
application.DisplayAlerts =False
For iSheet = 2 To iSheetMax
Sheets(2 + iSheetMax - iSheet).Delete
Next
application.DisplayAlerts =true



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default avoid warning when removing sheet

Hi Tijimen.

Try:

iSheetMax = Sheets.Count


Application.DisplayAlerts = False


' Delete other sheets
For iSheet = 2 To iSheetMax
Sheets(2 + iSheetMax - iSheet).Delete
Next


Application.DisplayAlerts = True


---
Regards,
Norman


"Tijmen" wrote in message
...
I want to remove all sheets except of sheet 1 by a macro

iSheetMax = Sheets.Count

' Delete other sheets
For iSheet = 2 To iSheetMax
Sheets(2 + iSheetMax - iSheet).Delete
Next

Then the user gets a warning message (warns for permanently deleting of
sheet).
I do not want this.

How can I prevent the warning message to appear?

Thanks,

Tijmen



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
removing sending mail warning Simon Excel Worksheet Functions 1 March 31st 08 02:19 PM
How to I Avoid the Auto-Email Security Warning Steve[_68_] Excel Programming 1 September 14th 04 05:15 PM
Removing Outlook Warning Dialogs. SNooGs[_2_] Excel Programming 1 July 30th 04 05:44 PM
Removing Outlook Warning Dialogs. SNooGs Excel Programming 0 July 30th 04 03:46 PM


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