98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - Setting all variables to zero
vba courses london - Setting all variables to zero
Resolved · Low Priority · Version Standard
Peter has attended:
Excel VBA Intro Intermediate course
Setting all variables to zero
We were shown how to set individual variables to zero (or empty them in the case of string varibles), but is there any one line piece of code to set all variables to zero or remove all variables in memory.
Thanks
RE: setting all variables to zero
Hi Peter
If you mean you want to initialise all variables to zero when you create them, you can create one main variable and set it to zero, then for all the other variables you create you can reference the original variable, thus they will be initialised to the value held within the original variable.
In regards to removing all variables in memory you want to use a process called garbage collection. I am not familiar with the code for this in VBA, but in asp.net the command is GC.Cellect(). I will look into this in greater depth and get back to you.
Hope this helps
David
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
VBA tip:Use GoTo to Select A Cell With VBATo select a certain cell on a Worksheet you can use: |