Excel: Declaring public variables


Is it good practice NOT to declare variables publically but instead define a class? So in place of this in a standard module:


Public FileNumber As Integer
use this in MyClass

Private mintFileNumber As Integer
Public Property Get FileNumber() As Integer
FileNumber = mintFileNumber
End Property
Public Property Let FileNumber(ByVal FNumber As Integer)
mintFileNumber = FNumber
End Property
but I still need to add this in a standard module:

Global MyFileNumber As MyClass
Thanks


This question generated 10 answers. To proceed to the answers, click here.

This thread is current as of October 01, 2014.


For more resources for Microsoft Excel