"Private Sub" v "Sub"
What are the differences between "Private Sub" and "Sub".
I am in the process of declaring all my variables in a very large and
complex workbook. (up until now I haven't bothered and am now suffering from
occasional crashes, I am hoping that declaring all variables and using
"Option Explicit" will cure this prob)
One thing that is puzzling me is that once a variable is declared inside one
sub, there appears to be no need to declare it inside another, unless the
"Sub" is a "Private Sub" I don't understand why this is because I am under
the impression taht a variable declared within a sub is unique to that sub.
Another abnormality. I have noticed that throughout my workbook the
"Address" keyword has turned into "addRess" (notice the upper case change)
The lines with this command in still work as they should but why ??
I have undoubtedly used "addRess" as a variable at some point, but I most
certainly don't have such a variable declared now! (I always capitalise a
middle letter of my variables so as they are more identifiable to me)
Since I never need to use a Sub from the macro toolbar, am I better of
having only Private Subs
|