Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statement" desperate insight is needed!!!!!! IF,Count, DCOUNT AHHHGGGGGGG! Chris Excel Worksheet Functions 1 November 9th 06 05:05 AM
Amateur VBA developr seek Professional similar for exchange of insight colofnature[_73_] Excel Programming 3 July 7th 06 12:40 PM
Any insight into cause of Autofilter buttons to stop working? Michael Excel Discussion (Misc queries) 4 August 18th 05 04:21 PM
VBA (or other) worksheet function parameter insight Marc Deveaux[_3_] Excel Programming 3 September 30th 04 11:44 PM
insight about excel programming needed bala Excel Programming 2 September 23rd 03 02:45 PM


All times are GMT +1. The time now is 12:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"