excel - 使用与 Dropbox 选择不同的文本更新单元格
问题描述
我创建了一个用户表单,其中包含一个包含不同选择的下拉框。然后将该选择放入单元格 C3。
我希望根据选择显示不同的文本。例如:如果我在下拉框中单击“测试一个”,则在 C3 中显示“选择了测试一个”。
我尝试了不同的公式。
我也不确定是为此添加一个模块还是将其放在用户表单的代码中。
解决方案
所以我想通了!这是我的新代码
私人子问题_ComboBox_Change()
Range("G3").Value = Problem_ComboBox.Text
If Problem_ComboBox.Value = "Parts On ZMIT - Vendor" Then Range("G3").Value = "1.1" If Problem_ComboBox.Value = "Parts On ZMIT - Internal" Then Range("G3").Value = "1.2" If Problem_ComboBox.Value = "Parts Not On ZMIT" Then Range("G3").Value = "1.3" If Problem_ComboBox.Value = "Waiting On Parts Warehouse" Then Range("G3").Value = "1.4" If Problem_ComboBox .Value = "Waiting On Parts Runner" Then Range("G3").Value = "1.5" If Problem_ComboBox.Value = "Rework Internal Manufacture - Assembly" Then Range("G3").Value = "2.1" If Problem_ComboBox. Value = "Rework Internal Manufacture - Fabrication" Then Range("G3").Value = "2.2" If Problem_ComboBox.Value = "Rework Internal Manufacture - Machine Shop" Then Range("G3").Value = "2.3" If Problem_ComboBox.Value = "Rework Purchased - Assembly" Then Range("G3").Value = "2.4" If Problem_ComboBox. Value = "购买的返工 - 制造" Then Range("G3").Value = "2.5" If Problem_ComboBox.Value = "购买的返工 - 机械车间" Then Range("G3").Value = "2.6" If Problem_ComboBox.Value = "工程/设计问题" Then Range("G3").Value = "3.1" If Problem_ComboBox.Value = "0-Series Build" Then Range("G3").Value = "3.2" If Problem_ComboBox.Value = "等待装箱单/标签/序列板”然后范围(“G3”).Value =“3.3”返工内部制造 - 机械车间" Then Range("G3").Value = "2.3" If Problem_ComboBox.Value = "Rework Purchased - Assembly" Then Range("G3").Value = "2.4" If Problem_ComboBox.Value = "购买的返工 - 制造” Then Range("G3").Value = "2.5" If Problem_ComboBox.Value = "购买的返工 - 机械车间" Then Range("G3").Value = "2.6" If Problem_ComboBox.Value = "Engineering / 设计问题" Then Range("G3").Value = "3.1" If Problem_ComboBox.Value = "0-Series Build" Then Range("G3").Value = "3.2" If Problem_ComboBox.Value = "Waiting On Packing列表/标签/序列板”然后是 Range(“G3”).Value = “3.3”返工内部制造 - 机械车间" Then Range("G3").Value = "2.3" If Problem_ComboBox.Value = "Rework Purchased - Assembly" Then Range("G3").Value = "2.4" If Problem_ComboBox.Value = "购买的返工 - 制造” Then Range("G3").Value = "2.5" If Problem_ComboBox.Value = "购买的返工 - 机械车间" Then Range("G3").Value = "2.6" If Problem_ComboBox.Value = "Engineering / 设计问题" Then Range("G3").Value = "3.1" If Problem_ComboBox.Value = "0-Series Build" Then Range("G3").Value = "3.2" If Problem_ComboBox.Value = "Waiting On Packing列表/标签/序列板”然后是 Range(“G3”).Value = “3.3”
结束子
推荐阅读
- database - 数据库 没有数据库?[需要建议]
- python - 使用 POW 对用户输入值进行平方
- angular7 - 如何在来自 Node API 的 Angular 中显示 quilljs 编辑器写入的数据
- angular - 覆盖来自不同项目的 sass 变量
- node.js - 节点:管道在暂停的直通上不阻塞
- datetime - 为什么从字符串到日期的转换不正确?
- java - 应用程序版本紧急更新时如何防止应用程序运行
- java - 无法使用 JSP 从 oracle 数据库中检索值,获取 java.sql.SQLException: Result set after last row
- python - 我应该使用哪个循环来删除使用 Selenium 的表中的所有数据条目?
- javascript - Javascript 在 Chrome/Firefox 中不起作用,但在 Safari 中正常