Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
validation - list option Susan Excel Worksheet Functions 1 March 11th 09 07:44 PM
Validation Options with option List EdoZwart Excel Discussion (Misc queries) 2 December 30th 05 08:36 PM
Macro to change validation list and print Andy Excel Discussion (Misc queries) 1 September 19th 05 01:42 PM
monitor cell that uses data validation list for change rgarber50 Excel Discussion (Misc queries) 2 August 1st 05 06:15 AM
What is the control called in the list option of validation? Bruce Excel Programming 1 May 26th 04 03:54 AM


All times are GMT +1. The time now is 03:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"