# VBA, module name , what are the naming convensions?



## krish (May 21, 2007)

Hi,

I tried to search MSDN for the naming convension for VBA modules. Couldn't locate any doc. If you know, could you please let me know the msdn link?.

for example, a module name shouldn't start with numbers or * etc.

thanks for the help


----------



## Norie (May 21, 2007)

krish

If you mean what's legal to name a module that's slightly different from a naming convention.

Naming conventions are generally a personal preference.

eg some people will precede each standard module name with mdl or a class module with cls


----------



## Von Pookie (May 21, 2007)

I searched the VBA help file for "module name" and found a topic of "Visual Basic Naming Rules." Seems like it would be what you want:



> Visual Basic Naming Rules
> 
> Use the following rules when you name procedures, constants, variables, and arguments in a Visual Basic module:
> 
> ...


----------



## Norie (May 21, 2007)

Kristy

Isn't that for "procedures, constants, variables, and arguments in a Visual Basic module:"?

I tried to find something about naming modules but I couldn't apart form this which I got when I hit Help when I tried naming a module with a number.


> Form and control names must start with a letter and can be a maximum of 40 characters — including letters, numbers, and underscores (_).


But that doesn't mention modules.


----------



## Von Pookie (May 21, 2007)

True. I think I read it incorrectly.

Oh well. It isn't going to hurt to know those rules, either


----------



## Norie (May 21, 2007)

Kristy

Nothing wrong with knowing the rules.

In fact I'm sure there's a thread on here somewhere that detailed what you could and couldn't use for Sub names.

Mind you I think I need to brush up on my spelling and/or typing.


> I couldn't apart *form* this


----------

