PC Review


Reply
Thread Tools Rate Thread

delete modules and sheets

 
 
mike allen
Guest
Posts: n/a
 
      9th Jan 2007
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


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      9th Jan 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete modules sunilpatel Microsoft Excel Programming 1 26th Jun 2009 05:25 PM
Re: Delete all modules but 1 John Spencer Microsoft Access Queries 1 10th Jul 2008 12:41 PM
How to run 2 CreateEventProc modules on 2 sheets simultaneously noname Microsoft Excel Programming 7 24th Oct 2007 03:59 AM
Please explain modules/sheets/workbooks Andrew Microsoft Excel Programming 5 11th Oct 2007 05:50 PM
Delete Modules in Macro =?Utf-8?B?TWFyaw==?= Microsoft Excel Programming 4 6th Mar 2005 05:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:06 AM.