View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Deleting element in Array

I think you have two choices in removing an element from an array - either
create a second array missing this element or move every element up one
place in the array and redim preserve it.

--
Jim
"ExcelMonkey" wrote in message
...
I have a 1-D array. A Routine checks the cells in a range
and fills it (based on a test - boolean) with cell
addresses. I want to run a second routine, which checks
this same range and performs another test - boolean. If
the boolean is false and this particular cell address
already exists in the array, then I want to delete its
existence in the array. How do I do this and redimension
the array so that it no longer includes the deleted
elements. THanks


?Array(0)
$A$1
?Array(1)
$A$2
?Array(2)
$A$3

After the second check I would like to see:
?Array(0)
$A$1
?Array(1)
$A$3