Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change/cycle cell entry to next option from validation list (macro
I was wondering if anybody knows a macro that could be used with cells that
are limited to containing values from a data validation list, so that when the macro is run, the cell entry for whichever cell(s) are selected changes to the next one in the list? E.g. If the data validation list contains the following values (in order): red blue yellow green If a cell is selected that currently displays "red" and the macro is run on that selection, then the cell will change to display "blue". If it is run again it will change to "yellow" etc... If the current value is the last one in the list (in this example, "green") and the macro is run, the fiirst entry is taken (i.e. it would cycle back to "red"). If the cell was originally blank, then the first value in the drop-down list would be entered. If possible, could the macro work on a selection rather than just a single cell, so more than one cell could be changed at a time? The possible values to choose from would ideally be ones just entered straight into the "source" section of the "data validation" dialog box, but if it is easier I could use a named range as the source (e.g. inserting the named range "colours"), or a cell reference, e.g. A1:A4. If possible, it would be great to have a generic macro that could be used with any cell containing a validation list (i.e. one that will work not just with the colours example I have given, but so that I could use it again with other cells, e.g. an "age" cell with a different validation list etc...) but I do not know if this is possible. I could always try to adapt the code for future examples if I can understand how it functions (e.g. what the parameters, references etc... used are). Again, if possible, the ideal situation would be to be able to use a similar macro to cycle through the list backwards. I'm afraid I don't know enough to know if this is possible, but any ideas would be greatly appreciated. Many thanks in advance, Neil |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
validation - list option | Excel Worksheet Functions | |||
Validation Options with option List | Excel Discussion (Misc queries) | |||
Macro to change validation list and print | Excel Discussion (Misc queries) | |||
monitor cell that uses data validation list for change | Excel Discussion (Misc queries) | |||
What is the control called in the list option of validation? | Excel Programming |