How to see all variables?

  • Thread starter Thread starter count
  • Start date Start date
C

count

This is likely to be elementary - apologies in advance :)

Is there a command or something I can type in Immediate box to show me what
variables and objects are still loaded?
I don't much believe in my coding and always suspect that I failed to Close
/ Nothing / Unload goods. Experience tells me that I really need this
facility.

I vaguely remember this sort of thing available in Realizer - first tool to
program in Windows I used. Anybody remembers Realizer? It's like Spooky
Tooth or Grand Funk Railroad - excuse my memory lane :)

Regards,
Paul
 
Variables are released when they go out of scope and the sub or function
where they are declared ends. If you don't have any global variables, then
you won't have a concern. If you do, then they will still be loaded until
the workbook is closed. There is usually little reason to perform any overt
action against them. They aren't released in any event - the most you can
do is clear the value they hold (exception would be a dynamic array).

Sub Test1()
dim rng as Range
set rng = Range("A1:A10")

set rng = Nothing
' rng still exists in memory - it just has a value of nothing


End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top