PDA

View Full Version : Sleeper: Looking for a data validation-like function



Ron1977
04-26-2005, 10:27 AM
Hi ,
I'm currently making a worksheet. For a particular column, the following must happen when the user selects a cell in that column:
-a dropdown icon appears next to the cell
-when he/she clicks the icon, a dropdown list appears in which values are shown. These values are present in an array 'aValidValues' .
-when the user clicks at a value in the dropdown list, the value becomes present in the cell itself.
-when the user selects another cell, the dropdown icon/list disappears at the previously selected cell. The value in the cell remains.

This looks familiar eh? It looks like the data validation functionality. However, I want some extra things:

When the user selects a cell and enters a string in that cell
-each array-item in the aValidValues array is checked for presence of the string
-if the array-item contains that string, it must appear in the dropdown list
-if the array-item does not contain the string, it must not appear in the dropdown list
-now the user can select a value from the (smaller) list, etc....

How can I implement this :dunno ? I can figure out the search-routine by myself, but I don't know:
-how you can put a dropdown icon/list at a cell
-how values of an array can be copied into the dropdown list of the cell.

Thanks in advance/regards
Ron

Killian
04-26-2005, 02:49 PM
Hi Ron and welcome to VBAX :hi:

I think you might want to take a look at this KB article (http://www.vbaexpress.com/kb/getarticle.php?kb_id=437). It shows how to add your own items to the worksheet right-click menu. You can adapt it to add a data validation item with the various options on a sub-menu.

Hope it helps