View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Paul Robinson Paul Robinson is offline
external usenet poster
 
Posts: 208
Default Resetting a variable to nothing

Hi
If it is an object variable use

Set object = Nothing

This is done to release memory. For other variables (Boolean, Double
etc) you should not need to set their value to nothing. A variable
defined inside a sub for example only exists for the lifetime of that
sub. During the sub, the variable is initialised to have some value
(otherwise you wouldn't define it in the first place) and ceases to
exist in memory at the end of the sub. There should not be a reason to
say the variable has no value - I don't know a lot about the memory
implications of variable declarations in VB mind, so don't take this
as Gospel!

regards
Paul


"Todd Huttenstine" wrote in message ...
How do I set a variable to nothing?