Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default clearing arrays

This newsgroup has been a big help. Thanks. I have one
more question. I'm just beginning to use arrays.

I read one record in a spreadsheet, and if it meets
certain conditions, an array is populated. The array is
then written somewhere else.

We go to the next record and look for certain conditions.
If we find it, we need to populat the array again.
However, there may be fewer or more items in the array
each time.

How do I clear an array so that it is empty when i go to
the next record. thanks for the help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default clearing arrays

Mike,

Here's an example

ReDim aryMe(UBound(aryMe, 1))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"mike" wrote in message
...
This newsgroup has been a big help. Thanks. I have one
more question. I'm just beginning to use arrays.

I read one record in a spreadsheet, and if it meets
certain conditions, an array is populated. The array is
then written somewhere else.

We go to the next record and look for certain conditions.
If we find it, we need to populat the array again.
However, there may be fewer or more items in the array
each time.

How do I clear an array so that it is empty when i go to
the next record. thanks for the help



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default clearing arrays

Be sure to declare the array as a dynamic array; then you can simply
ReDim it, e.g.

Dim arr()
ReDim arr(5, 3)
'Load arr and write it to somewhere else
Erase arr 'This is optional, to be used if it's desirable
'to free memory before arr is used again
ReDim arr(7, 5)
'Load array and write it to somewhere

Alan Beban

mike wrote:
This newsgroup has been a big help. Thanks. I have one
more question. I'm just beginning to use arrays.

I read one record in a spreadsheet, and if it meets
certain conditions, an array is populated. The array is
then written somewhere else.

We go to the next record and look for certain conditions.
If we find it, we need to populat the array again.
However, there may be fewer or more items in the array
each time.

How do I clear an array so that it is empty when i go to
the next record. thanks for the help


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
Clearing cells without clearing formulas marsjune68 Excel Discussion (Misc queries) 2 April 10th 09 07:39 PM
Clearing formulations Sue Excel Discussion (Misc queries) 2 June 12th 08 12:11 PM
Clearing a cell basil Excel Discussion (Misc queries) 4 April 30th 07 11:28 AM
Clearing #N/A's in one go? Lee Harris Excel Worksheet Functions 5 November 22nd 05 06:52 PM
Clearing #VALUE skateblade Excel Worksheet Functions 3 October 15th 05 10:34 PM


All times are GMT +1. The time now is 03:21 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"