LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 325
Default Values assigned to variables staying in memory when procedure stop

Good afternoon, again!

I have a Worksheet_Change macro that only kicks in if the TARGET is within
certain worksheet boundaries.

Within this macro, I have a MSGBOX that displays the values of the variables
containing the first/last rows/columns in my "Database" range, which are
usually set by a macro called DefineDatabase. However, although
DefineDatabase isn't run before the MSGBOX is displayed, it displays the
correct values! The variables in question are declared at Module and not
Procedure level.

DefineDatabase HAS been run several times times throughout the morning as
part of my testing, and it doesn't contain any commands to set the variables
to zero before it starts, or when it finishes.

I somewhat mistakenly thought that when a macro stopped running, the values
held by variables were reset to NOTHING/NIL/NADA/ZERO. Is this not the case?
The variables concerned are declared as PUBLIC, so as to be available to
macros in more than one module, but they're not STATICs or anything like that.

It's probably just a Friday afternoon thing, but I'd be grateful if someone
could help me out here, otherwise I'm liable to spend all weekend thinking
"...but how dows it KNOW?"

Yes, I know I should get out more often..! :-)

Thanks in advance and have a good weekend

Pete


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop a Procedure from another procedure Ayo Excel Discussion (Misc queries) 1 October 30th 08 01:42 AM
How do I stop Excel 2002 draining CPU Memory Mark Royle Excel Discussion (Misc queries) 1 April 27th 06 08:00 PM
How do I stop Excel 2002 draining Available Memory Mark0411 Excel Discussion (Misc queries) 0 January 7th 06 08:41 PM
how to clear memory stored in the variables? KiriumF1 Excel Programming 6 December 7th 04 10:53 AM
free up memory by deleting variables clui[_11_] Excel Programming 4 December 11th 03 01:10 AM


All times are GMT +1. The time now is 07:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"