
Originally Posted by
HTSCF Fareha
I have a question regarding the resetting of variables at the end of a sub macro (Hoping that resetting is the correct description!).
Would I be correct in saying that it is best practice to do this for each variable that is declared at the start of a sub, or is this not the case and only certain ones need this?
I believe that the garbage collection kicks in at the End Sub/Function for any variables instantiated within the procedure, so I've been told that it's not necessary
HOWEVER ... I like to do it with those and some other constructs since the 'bracketing' helps me see things
Dim myObj as Class1
Set myObj = New Class1
...
...
...
Set myObject =Nothing
Personal style