View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Kevin B Kevin B is offline
external usenet poster
 
Posts: 1,316
Default Prevent Overloaded variables

I use a naming convention so that variables declared at the top of a molule
as constants have a 'con' prefix. So if I have a constant named conFilePath
and I need to declare a file path string variable in another sub or
funcition, in the a sub or function I use a 'str' prefix to denote a string
variable.

That would eliminate conficting names at the module, and procedure level.
--
Kevin Backmann


"Jeff" wrote:

Hi,

I have some variables declared at the top of the module, so they are used
throughout the program. But here is the problem, I can redeclare the
variable inside another sub procedure, how do I prevent this? This seems
like bad feature to have in excel.

I declared option explicit at the top.

Thanks for your help.