Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default delete modules and sheets

I am having problems with a very simple routine I have done before. None of
the the three commands works in this code (1-delete modules, 2-delete
multiple sheets, 3- have no alert flash when deleting).
Sub test()
DisplayAlerts = False
Modules("module2", "module3").Delete
Sheets("sheet2", "sheet3").Delete 'I can delete one sheet at a time
DisplayAlerts = True
End Sub

Thanks, Mike Allen


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default delete modules and sheets

You can use code at Chip Pearson's site to remove the modules:
http://cpearson.com/excel/vbe.htm

If sheet2 or sheet3 (or both) don't exist, then you'll have trouble.

But you can delete multiple sheets with:
Worksheets(Array("sheet2", "sheet3")).Delete

mike allen wrote:

I am having problems with a very simple routine I have done before. None of
the the three commands works in this code (1-delete modules, 2-delete
multiple sheets, 3- have no alert flash when deleting).
Sub test()
DisplayAlerts = False
Modules("module2", "module3").Delete
Sheets("sheet2", "sheet3").Delete 'I can delete one sheet at a time
DisplayAlerts = True
End Sub

Thanks, Mike Allen


--

Dave Peterson
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 all modules and forms from workbook Daniel Bonallack Excel Programming 2 June 2nd 06 02:34 AM
Delete Code Modules Programatically blatham Excel Discussion (Misc queries) 1 February 3rd 06 05:38 PM
Delete Modules in Macro Mark Excel Programming 4 March 6th 05 05:42 PM
Delete modules programmatically and save Brijesh Shah Excel Programming 3 December 24th 03 08:14 PM
Delete Modules and Userforms Peter Pantus Excel Programming 1 September 26th 03 08:17 PM


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