+ Reply to Thread
Results 1 to 3 of 3

Set array element to empty

  1. #1
    Raul
    Guest

    Set array element to empty

    I have an array that is type single and I would like to delete values that
    meet a certain criteria. If the array was variant I could set the a
    particular array element to "". How do I do something similar for an array
    that is not variant?

    Thanks,
    Raul

  2. #2
    Jake Marx
    Guest

    Re: Set array element to empty

    Hi Raul,

    A Single does not have an "empty" value. Its initial value is 0. So the
    best you can do is set its value to 0 when you want to "clear" it. So, in
    your case, you may want to either 1) use a Variant array and set the values
    to be cleared to vbNullString (or ""); or 2) use a Single array as the
    source, and create a new Single array, copying only the values you need from
    the source array.

    --
    Regards,

    Jake Marx
    MS MVP - Excel
    www.longhead.com

    [please keep replies in the newsgroup - email address unmonitored]


  3. #3
    Raul
    Guest

    Re: Set array element to empty

    Thanks a bunch for the quick and informative respsonse! In this case I'll go
    with option 1.

    Thanks again,
    Raul

    "Jake Marx" wrote:

    > Hi Raul,
    >
    > A Single does not have an "empty" value. Its initial value is 0. So the
    > best you can do is set its value to 0 when you want to "clear" it. So, in
    > your case, you may want to either 1) use a Variant array and set the values
    > to be cleared to vbNullString (or ""); or 2) use a Single array as the
    > source, and create a new Single array, copying only the values you need from
    > the source array.
    >
    > --
    > Regards,
    >
    > Jake Marx
    > MS MVP - Excel
    > www.longhead.com
    >
    > [please keep replies in the newsgroup - email address unmonitored]
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1