Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2013, 07:29 AM
Greg S. Greg S. is offline Empty Modules Windows 7 32bit Empty Modules Office 2013
Novice
Empty Modules
 
Join Date: Jul 2013
Posts: 4
Greg S. is on a distinguished road
Default Empty Modules

I'm really a novice to Excel VBA, and I see a number of modules that appear to be empty in Project Explorer. I double-click on the modules and an empty page comes up.

But I don't know why they'd exist if they're really empty. If I delete them am I going to change something I shouldn't? Or are these macros I've deleted that left their shells behind, and so there's no problem deleting them?
Reply With Quote
  #2  
Old 07-28-2013, 05:07 AM
BobBridges's Avatar
BobBridges BobBridges is offline Empty Modules Windows 7 64bit Empty Modules Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

If you no longer need the contents of a module you created, then you can use the Remove option in the Project window to delete the whole module, not just the code in it. It'll ask you whether you want to export the code to a text file, first, just as a precaution; you can make your own mind up about that.

And yeah, when you insert code modules, the VB Editor names them Macro1, Macro2 etc by default (you can change those names if you choose). The same when you record a macro; Excel puts each recorded macro in a module with a name like that. So if you're not using those modules any more, you can definitely delete them.

As a general technique, when you're wondering whether you can safely delete something, you can always make a backup of the workbook, then delete the module(s and see what happens. But you're safe in this case.
Reply With Quote
  #3  
Old 07-30-2013, 01:38 PM
Greg S. Greg S. is offline Empty Modules Windows 7 32bit Empty Modules Office 2013
Novice
Empty Modules
 
Join Date: Jul 2013
Posts: 4
Greg S. is on a distinguished road
Default

Yeah, it seems that for whatever reason when you delete a macro you don't automatically delete the module. That seems weird, but if that's how it works that's how it works! Thanks for your help.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mirrored Files are Empty sussertown Office 0 04-01-2013 08:21 AM
Empty Modules Empty cells plotted as zero. ColinC Excel 3 03-04-2013 04:57 AM
Apparently empty (blank) cells aren't empty daymaker Excel 3 03-08-2012 03:41 PM
Empty Modules Empty rules rene.kamphuis@ciz.nl Mail Merge 21 04-15-2011 12:34 AM
Populate an empty .PAB file imported_contiw Outlook 2 08-17-2006 08:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft