View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Can I do this with arrays?

Never mind! When I dropped this into the macro I was using to test my
"trials and errors", I reassigned all the variables in your code to match my
code - except
myCount = myCount - 1
so when I reached
ReDim Preserve Arr2(1 To myCount)
which now reads
ReDim Preserve Arr2(1 To z)
it didn't work as you designed. With the *correct* variable, though, it
works great!

Thanks again!
Ed

(PS - I'm using this to resolve an issue from an earlier post of mine: how
to create a range that excludes another range ("How to exclude certain cells
from a range?", posted 1/9/2006 - http://tinyurl.com/78vt8)

"Ed" wrote in message
...
I put the Option Base 1 in as a matter of course - it's too much extra

work
for me to remember to subtract 1! <g

I did notice that the revised array (Arr2) is still as large as before -
that is, UBound before and after are the same. Going from Tom's response,
I'm assuming this is because some value positions are now "" or null, but
are still there. I must have missed something in your code when I
transposed it into mine. If I find it, I'll let you know.

Ed

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Beautiful, Bernie! Thank you!!


You're welcome.

I forgot to mention that the code, as written, requires

Option Base 1

at the top of the module.

HTH,
Bernie
MS Excel MVP