I never really know how to name VBA modules. Should I:
- Use a prefix, like basName or modName.
- Not use a prefix, like Module. (But avoid restricted words)
- Something else
I never really know how to name VBA modules. Should I:
Do not prefix! Name the module appropriately for what it does.
Granted, this is taking the way back machine, but when I did extensive VBA development, I always named my modules with a prefix of something like "bas" because the names of Class modules and Global modules in combination had to be unique (i.e. you couldn't have a Global module named Foo and Class module named Foo). I believe the same was true of VB6 but that was many moons ago.
A prefix can be useful just for the sake of making related modules appear next to each other in the project window. I use prefixes like "numeric" or "test" all the time in lieu of some other way to group them. But you probably don't need something like "mod"...
I prefix standard modules with M, class modules with C, and userforms with U. In the VBE, I turn off the folder view in the project explorer to show all of the modules. The prefixes keep them nicely sorted.