Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default free up memory by deleting variables


I have tons of variables in my VBA code and need to delete some of the
when they're no longer needed. What's the code for that? Fo
example, how do I delete myarray(13,18)? Thanks

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #2   Report Post  
Posted to microsoft.public.excel.programming
pk pk is offline
external usenet poster
 
Posts: 27
Default free up memory by deleting variables

To clear an array use: ERASE

Erase myarray(13, 18)

HTH

-----Original Message-----

I have tons of variables in my VBA code and need to

delete some of them
when they're no longer needed. What's the code for

that? For
example, how do I delete myarray(13,18)? Thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step

guide to creating financial statements
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default free up memory by deleting variables

If it is dynamic, then

erase myarray

if it is a variant variable containing an array

myArray = ""

Otherwise I believe you would have to go out of scope.

--
Regards,
Tom Ogilvy

"clui" wrote in message
...

I have tons of variables in my VBA code and need to delete some of them
when they're no longer needed. What's the code for that? For
example, how do I delete myarray(13,18)? Thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to

creating financial statements


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default free up memory by deleting variables

Just to add,
That doesn't free up any memory if the array is not dynamic.

from help for Erase:

Reinitializes the elements of fixed-size arrays and releases dynamic-array
storage space.

--
Regards,
Tom Ogilvy

pk wrote in message
...
To clear an array use: ERASE

Erase myarray(13, 18)

HTH

-----Original Message-----

I have tons of variables in my VBA code and need to

delete some of them
when they're no longer needed. What's the code for

that? For
example, how do I delete myarray(13,18)? Thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step

guide to creating financial statements
.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default free up memory by deleting variables

Tom,
Any guidance on using Erase (like Set Object = Nothing)? I had assumed a
program will release the memory when it completes.

Alex J

"Tom Ogilvy" wrote in message
...
Just to add,
That doesn't free up any memory if the array is not dynamic.

from help for Erase:

Reinitializes the elements of fixed-size arrays and releases dynamic-array
storage space.

--
Regards,
Tom Ogilvy

pk wrote in message
...
To clear an array use: ERASE

Erase myarray(13, 18)

HTH

-----Original Message-----

I have tons of variables in my VBA code and need to

delete some of them
when they're no longer needed. What's the code for

that? For
example, how do I delete myarray(13,18)? Thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step

guide to creating financial statements
.





Reply
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
Repayment of loan excel sheet with variables of principal free pay Morten Excel Worksheet Functions 1 May 11th 09 11:46 AM
EARN,20000$ & ALL TYPES SOFTWARE FREE DOWNLOAD,& KATRINA KAIF OPENVIDEOS & WEBSITE DEV TO FREE ALL OVER THE WORLD`S PEOPLE SAI BABA Excel Worksheet Functions 0 January 25th 09 01:10 PM
Free social world wide network pays for 10 generations! Free! alabatros1 Excel Discussion (Misc queries) 0 November 15th 08 09:52 PM
Where free 2 sigma statistical process control chart, free? Blankenh Charts and Charting in Excel 0 January 16th 08 10:28 PM
Free old variables Jeff Excel Discussion (Misc queries) 2 April 16th 07 09:10 PM


All times are GMT +1. The time now is 12:53 AM.

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

About Us

"It's about Microsoft Excel"