+ Reply to Thread
Results 1 to 2 of 2

Weird Validation Trick

  1. #1
    Registered User
    Join Date
    05-20-2010
    Location
    Washington DC
    MS-Off Ver
    Excel 2003
    Posts
    20

    Weird Validation Trick

    What I'm trying to do is difficult to explain. I'm trying to create a data validated field with a list that is comprised of the entries made on that field. For instance, say the field is A1:A10. All cells are blank. When I enter text into any of the fields, A1:A10, that text is automatically added to the validation list assuming it is a unique entry. Duplicate entries are permitted, but they are not added to the list. Only unique entries are added to the list.

    I have achieved this, but to a smaller scale than desired. See the example uploaded to my google.docs page:

    https://docs.google.com/leaf?id=0B3X...thkey=CIWggOMC

    I'm working on a spreadsheet that will contain 6,500 cells of potential data entry. These cells will be very much like cells A2:A12 in my example file. These cells will also produce a raw list, like cells I2:I12, and a "no repeats" list like in cells J1:J12.

    The formula for the "no repeats" list in the example is
    Please Login or Register  to view this content.
    This isn't very processor intensive. However, when the range is $I$1:$I$6500, calculation becomes painfully slow.

    I'm looking for a method for rooting out repeats that is not so demanding on the CPU. Every time I enter data on the entry field, the CPU is forced to check the other 6500 cells for repeats.

    Thus far, I have attempted to break the list up into parts. Instead of 1 no "repeats list" for 6500, I had 13 "no repeats" lists for 500. Each "No Repeats" list fed to a master "no repeats" list. All in all, this reduced my cpu's workload considerably, or at least I thought. Unfortunately, this did not improve performance.

    I'm at a loss. Does anyone know of a more efficient way to achieve this? I'd be up for a VBA solution, but I can't think of one. Any help with this would be greatly appreciated.

    Weird Validation Trick
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Weird Validation Trick

    Hello 3link,

    "Sheet2" has the modified version of what you want to do. The macro uses the Worksheet_Change event to monitor when an entry has been added or deleted from the "raw list". The "main list" is then updated with no duplications. This is accomplished by using a VBA Dictionary object which functions like a "hash table" or "associative array". this allows a lot of flexibility and speed in handling data.

    I created a named range called "Main_List" which the Data Validation drop downs use. The is a dynamic named range. It will automatically adjust as you add or remove data to the range. The attached workbook has all the changes. Try it out and let me know what you think about it.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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