Evening to everyone,
I would like to know if there is a way to remove the instance variables (I guess this is the right term) which I use when creating a user define class. Attached you will find the class I am intending to create.
Libro2.xlsm
Here's a little fragment:
CLASS NAME: cFeedType
Private oRang As Range
Private sName As String
Private sIndx As Integer
Private cFtags As cTags
Private cCtags As cTags
Property Get URange() As Range
URange = oRang
End Property
Property Set URange(nRang As Range)
Set oRang = nRang
End Property
Property Get SheetName() As String
SheetName = sName
End Property
Property Let SheetName(nName As String)
sName = nName
End Property
Property Get SheetIndex() As Integer
SheetIndex = sIndx
End Property
Property Let SheetIndex(nIndx As Integer)
sIndx = nIndx
End Property
Property Get CompositionTags() As cTags
Set CompositionTags = cCtags
End Property
Property Set CompositionTags(nCtags As cTags)
Set cCtags = nCtags
End Property
Property Get FlowrateTags() As cTags
Set FlowrateTags = cFtags
End Property
Property Set FlowrateTags(nFtags As cTags)
Set cFtags = nFtags
End Property
Private Sub Class_Initialize()
Set oRang = Worksheets(1).Range("A1")
Set cFtags = New cTags
Set cCtags = New cTags
sName = "FEED"
sIndx = 0
End Sub
Private Sub Class_Terminate()
Set oRang = Nothing
Set cFtags = Nothing
Set cCtags = Nothing
End Sub
My question: is there a way to eliminate variables like sIndx, sName, oRange once I create an object using this class?
When I do the following in a standard module:
Dim Feed as new cFeedType
Sub test()
Feed.SheetName = "WHATEVER"
End Sub
On debug mode, you still can see sIndx, sName, and oRange as Object Variables.
Can anyone help me on this one?
Bookmarks