Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro (Modle) naming insight
Hello all,
As you know, I'm new to VB coding and I had a question about modles with names. How do they work? I changed a name on a modle so I can find it easly in a list of modles, but it did not work after that and if I "Call" another modle (macro) it also did not work. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro (Modle) naming insight
Do you mean Modules?
-- HTH... Jim Thomlinson "pgarcia" wrote: Hello all, As you know, I'm new to VB coding and I had a question about modles with names. How do they work? I changed a name on a modle so I can find it easly in a list of modles, but it did not work after that and if I "Call" another modle (macro) it also did not work. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro (Modle) naming insight
Opps, sorry, yes please.
"Jim Thomlinson" wrote: Do you mean Modules? -- HTH... Jim Thomlinson "pgarcia" wrote: Hello all, As you know, I'm new to VB coding and I had a question about modles with names. How do they work? I changed a name on a modle so I can find it easly in a list of modles, but it did not work after that and if I "Call" another modle (macro) it also did not work. Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro (Modle) naming insight
Naming your modules if a very good practice to get into. At allows you to
organize your code which makes it a lot easier to maintain. Try to give your modules descriptive names so that you know what is in them... One nice thing about naming your modules is that you gain intellisence drop downs. Try this... name a new module modNew and add the following procedures. '******************* public sub MyPublicSub() msgbox "Tada" call MyPrivateSub end sub private sub MyPrivateSub() msgbox "Scooby Doo" end sub '******************* Now in another module or sheet type modnew. You should get an intellisence drop down including MyPublicSub but not MyPrivateSub. You do not necessarily need to specify the module where your procedure is. If you just typed Call MyPublicSub then the compiler will search the module or object you are in. If it is not found then it will look in other modules. If it does not exist elsewhere then you will get an error message. If it is elsewhere but declared private then it will not be found. If it is in two or more modules then you will get an ambiguious call error. I try to include the module name in my call. It self documents the code and keeps me from spelling / typing things wrong. It also ensures that the scope of my procedures is correct and avoid ambiguious calls. -- HTH... Jim Thomlinson "pgarcia" wrote: Opps, sorry, yes please. "Jim Thomlinson" wrote: Do you mean Modules? -- HTH... Jim Thomlinson "pgarcia" wrote: Hello all, As you know, I'm new to VB coding and I had a question about modles with names. How do they work? I changed a name on a modle so I can find it easly in a list of modles, but it did not work after that and if I "Call" another modle (macro) it also did not work. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
if statement" desperate insight is needed!!!!!! IF,Count, DCOUNT AHHHGGGGGGG! | Excel Worksheet Functions | |||
Amateur VBA developr seek Professional similar for exchange of insight | Excel Programming | |||
Any insight into cause of Autofilter buttons to stop working? | Excel Discussion (Misc queries) | |||
VBA (or other) worksheet function parameter insight | Excel Programming | |||
insight about excel programming needed | Excel Programming |