Deleting macros?

J

Jay

Hi,

I'm a macro novice and tend to just record them rather than dabbling in VBA.

If I save a macro to my personal macro workbook, how do I delete it? as it
says I need to unhide personal.xls to do this?

Many thanks,

Jay
 
B

Bob Phillips

Go to the VBIDE, and select Personal.xls from the project explorer. Open the
code module and just delete the macro.
--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
J

Jay

Thanks Bob,

The macros I recorded are saved in personal.xls as separate modules. - Is it
better if they are all in the same module? and if so how is this done?

Regards,

Jason
 
B

Bob Phillips

Jay,

Classic answer ... it depends.

If you have just a few macros, it is probably better to put them all in one
module, although it shouldn't make any difference, as it will be easier to
find them. Just cut them out of the other modules, and paste them into your
single module, then delete the empty modules.

Conversely, if you have lots of macros, it is probably better to group them
into functionally similar modules (e..g. all file I/O macros, all formatting
macros). It is also a good idea to give these modules meaningful names, such
as mIO, mFormatting, again to aid maintenance. This is how I group my code.

After a while, a single module can fail if you put too much code (circa 64K)
in there.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
J

Jay

Thansk Bob, that's what I thought. One other macro-related question (if I
may) - when a colleague of mine has more than one excel file open he gets
the following error message if he tries to use a macro:

PERSONAL.XLS is locked for editing by......
Open Read-Only or, click 'Notify' to open read-onlu and receive notification
when the docuemtn is no longer in use.

Could you advise why this is happening and how to prevent it, as he needs to
use macros with two files open.

Many thanks,

Jay
 
B

Bob Phillips

Sounds to me that he is starting two instances of Excel, which will both
open Personal.xls, rather than just opening both files in the same instance.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top