简体   繁体   English

从另一个单元格填充的动态数据验证列表

[英]Dynamic data validation lists populated from another cell

I am trying to achieve two things which I presume are possible but I'm unsure of where to start.我正在努力实现我认为可能的两件事,但我不确定从哪里开始。

在此处输入图片说明

What I am hoping to achieve is to populate the list (shown in cell C4) with the data entered in cell A3.我希望实现的是使用单元格 A3 中输入的数据填充列表(显示在单元格 C4 中)。 What I don't know is how to make the A3 string breakdown based on the comma delimiter so that it is not one long string, but rather results in a list at C4, as displayed in the screenshot.我不知道如何根据逗号分隔符对 A3 字符串进行细分,使其不是一个长字符串,而是在 C4 处生成一个列表,如屏幕截图所示。

Note : I have hardcoded the list shown in the screenshot as I wanted to show what I need to achieve.注意:我对屏幕截图中显示的列表进行了硬编码,因为我想展示我需要实现的目标。 If I reference A3 directly (=$A$3), my list only has one item - 'Yes, No, I don't know', opposed to the list displayed in the screenshot.如果我直接引用 A3 (=$A$3),我的列表只有一项 - '是的,不,我不知道',与屏幕截图中显示的列表相反。

Then, if this is possible, instead of hard coding A3 as the reference, I want to read the value in B4.然后,如果这是可能的,而不是硬编码 A3 作为参考,我想读取 B4 中的值。 This would allow me to change the value of B4 to point at any other cell, such as A6.这将允许我将 B4 的值更改为指向任何其他单元格,例如 A6。

I believe both these things are likely possible but Googling has not helped as it appears I'm searching for the wrong keywords.我相信这两件事都是可能的,但谷歌搜索并没有帮助,因为我似乎在搜索错误的关键字。

May be you can try to separate them in cell A3也许您可以尝试在单元格 A3 中将它们分开

=SUBSTITUTE(LEFT($A$2,FIND(",",$A$2,1)),",","")

and try to paste as will in Cell A4并尝试在单元格 A4 中粘贴

=MID(A2,FIND("Yes",$A$2,2),3)

so as will separate the last word to cell A5以便将最后一个单词分隔到单元格 A5

=RIGHT(A2,LEN(A2)-FIND("Yes, ",$A$2)-4)

And your Source in your data validation would be你的数据验证中的来源将是

=$A$2:$A$4

Instead of having all options in one cell, why don't you just make a list across different columns and then enter in the reference cell the letter of the column.与其在一个单元格中包含所有选项,不如在不同的列中列出一个列表,然后在参考单元格中输入该列的字母。 Then in your validation, use indirect(cell ref & "1:" & cell ref & "Max row num").然后在你的验证中,使用indirect(cell ref & "1:" & cell ref & "Max row num")。

Or better yet, name the ranges, then simply list the name of the range in the reference cell and use indirect(cell ref) to dynamically change drop down options.或者更好的是,命名范围,然后简单地在参考单元格中列出范围的名称,并使用间接(单元格引用)来动态更改下拉选项。 Eg your range would be named "fruit", in b4 you would enter "fruit".例如,您的范围将命名为“fruit”,在 b4 中,您将输入“fruit”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM