I have several variables declared at the top of my UserForm (outside of any procedure), some of them are ranges, ListObjects, and PivotTables. Is it necessary to use
before closing the UserForm to remove them from memory, or will they automatically go out of scope when the UserForm is closed - by clicking the X on the upper-right of the UserForm?
My understanding was that UserForm level variables are similar to Module level variables, and I was reading here (http://www.ozgrid.com/VBA/variable-scope-lifetime.htm) and it sounds like Module Level variables are retained until the Workbook is closed or End is used;
"Its value is retained unless the Workbook closes or the End Statement is used."
But I'm still not positive this is exactly the same as a UserForm.
Code:
Set variable = nothing
before closing the UserForm to remove them from memory, or will they automatically go out of scope when the UserForm is closed - by clicking the X on the upper-right of the UserForm?
My understanding was that UserForm level variables are similar to Module level variables, and I was reading here (http://www.ozgrid.com/VBA/variable-scope-lifetime.htm) and it sounds like Module Level variables are retained until the Workbook is closed or End is used;
"Its value is retained unless the Workbook closes or the End Statement is used."
But I'm still not positive this is exactly the same as a UserForm.