1

I have a simple spreadsheet about musical notes that does the following:

First, a user chooses whether to display sharps or flats by choosing this from a drop-down menu. This triggers other cells in the spreadsheet to display the chromatic scale in either sharps or flats. See below.

enter image description here

enter image description here

This works fine. Then another cell uses data validation for a drop-down menu where one of these notes can be chosen. See below.

enter image description here

enter image description here

This works fine as well except that cell D2 does not automatically update to the corresponding cell in the data validation list if cell B2 is changed. In other words, if cell B2 is changed, it is possible that cell D2 contains text that does not appear in the list of notes. See below for a visualization of this.

enter image description here

In the image above, cell B2 was changed to "Sharps" which correctly updated the list of notes. However, since cell D2 had already chosen a flat note (in this case, Db), cell D2 did not automatically update to its corresponding sharp note (in this case, C#).

All that said, my question is: Is it possible to have cell D2 automatically update to its corresponding value in the data validation list of notes, if the data validation list changes? (preferably without the use of VBA)

7
  • How did you set up your dependent data validation? Commented Sep 22, 2017 at 2:06
  • @RonRosenfeld Data Validation, Allow: List, Source: $B$6:$B$17 Commented Sep 22, 2017 at 2:15
  • What about the list in D2? Commented Sep 22, 2017 at 2:16
  • My comment was referring to the list in D2 Commented Sep 22, 2017 at 2:17
  • Of course. Sorry. To keep the lists from getting out of sync, you can either prevent changing B2 if there is an entry in D2, by changing the formula; or you can use VBA to clear D2 if a change is made in B2. Commented Sep 22, 2017 at 2:19

1 Answer 1

1

To prevent changing B2 when there is an entry in D2, can be done by changing the DV formula to return an error, or, more simply, FALSE when D2 is non-blank. You should add an explanatory message so the user doesn't think the system has frozen.

e.g:

In the formula under Source,

F1:  Sharps
G1:  Flats

You may need to actually clear D2 in order to enter the formula.

When D2 is not clear, you will be able to select B2, but you will not be able to change it.

enter image description here

This just shows a possible message to be displayed when the cell is selected.

enter image description here

If you want the entry in B2 to change to the corresponding note when you change from Sharps to Flats (or vice versa) would require VBA.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the answer Ron. This isn't ideal because it doesn't allow cell B2 to change. However, I still marked your answer as corrected and gave it a +1 because of all your help with this.
@Peter Without VBA, don't know what else. With VBA event code, certainly doable. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.