Microsoft Excel - Enter Same Data Multiple Cells from validation list

Asked By John Wirth on 12-Jun-13 05:22 AM
I know the short cut to enter a typed value into multiple selected cells- control + enter, but is there any way to make this happen if value is selected from a validation list- i.e. multiple cells are selected and the active cell has a value from the list selected, and this value is entered into all selected cells. Would also be good if there was a way to prevent cells that have different validation in the selection prevented from being populated by the data and only cells with the same items in the list populated.
Harry Boughen replied to John Wirth on 12-Jun-13 08:15 AM
Hello John,
Not sure but I suspect that you might need a macro that triggers when you select from the dropdown and checks every cell validation status before setting the value.  Whether such a function is possible I don't know at this stage but will have a look when I get a moment.
In the meantime, maybe somebody else will know.
Regards
Harry
Harry Boughen replied to John Wirth on 13-Jun-13 03:11 AM
Hello John
The attached file sort of works.

john3.zip

Unfortunately the event does not trigger when you select from the dropdown list and the relevant cell has to be the top left of the selected range (say A1:F8).  You have to enter a valid value in the formula bar and click the 'tick'.  This triggers the event and it fills the cells that use the same list with the value entered.  Cells without a validation list (just for test purposes) it fills with nv and cells with the alternate validation list are left unchanged. If you choose a single cell or the first (top left) cell does not have a validation list it does nothing.

Hope this gets you started if nothing else.  let me know if you need more help or have problems.
Regards
Harry

UPDATE: Am working on an old computer and it might work OK on more modern versions of Excel.  Will try when I get a chance.
H
Harry Boughen replied to John Wirth on 13-Jun-13 05:20 AM
John,
A further update.  Change one line in the macro:  Set rngSelect = Target to  Set rngSelect = Selection.
This still has problems in early Excel but seems to work OK in later versions.
Regards
Harry
Harry Boughen replied to John Wirth on 13-Jun-13 05:03 PM
Hello again John,
Realised that I had left some test code in the file that I posted that might have caused some confusion.  Also didn't mention that the code is located in worksheet1 on worksheet _change.  Here is the corrected and annotated file.  Comments about how to get it to work in excel97 still apply.
john3a.zip
Regards
Harry
John Wirth replied to Harry Boughen on 14-Jun-13 05:01 AM
Harry, that is so helpful and works like a charm, thank you. Since my initial post I had managed to get to the point where I could apply a value selected from a validated list to multiple cells, but was completely stuck on not apply the value to cells within the selected range with no validation or different validation criteria. I will have a look at the code so I can learn from it.
I have some additional code to apply values to multiple selected sheets which I can integrate very easily as it has the condition that more than one sheet is selected.
Once again, thank you very much.

John