Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
At the top of my module, I have
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) I want to Dim some variables that will be used by several subs in this module. Do I put them above the Private for the Sleep, or between this and my first Sub? Ed |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Doesn't really matter. I tend to put APIs first, then private, then public
variables. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Ed from AZ" wrote in message ups.com... At the top of my module, I have Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) I want to Dim some variables that will be used by several subs in this module. Do I put them above the Private for the Sleep, or between this and my first Sub? Ed |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It's a matter of taste.
Personally, I use very few module-level variables, preferring to pass variables as arguments, but my preference would be to declare the variables first. In article . com, Ed from AZ wrote: At the top of my module, I have Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) I want to Dim some variables that will be used by several subs in this module. Do I put them above the Private for the Sleep, or between this and my first Sub? Ed |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to you both. I appreciate the boost.
Ed |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Per Ed from AZ:
At the top of my module, I have Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) I want to Dim some variables that will be used by several subs in this module. Do I put them above the Private for the Sleep, or between this and my first Sub? My experience is that it Excel doesn't care. I, however, prefer to have the Lib declarations as the last lines in my module-level declarations. No particular reason.... just started off that way. I'd guess, the value is in consistency - whichever way you do it. -- PeteCresswell |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'd use multiple modules.
One for the APIs and one for the public variables. Ed from AZ wrote: At the top of my module, I have Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) I want to Dim some variables that will be used by several subs in this module. Do I put them above the Private for the Sleep, or between this and my first Sub? Ed -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Declare and Set Public variables | Excel Discussion (Misc queries) | |||
Declare a class module in General Declarations | Excel Programming | |||
Declare at application level | Excel Programming | |||
use of module level variables | Excel Programming | |||
how to declare a class module | Excel Programming |