根据在下拉菜单中所做的选择,尝试编写代码以使用下拉菜单填充与单元格相邻的单元格。
我需要这个仅适用于活动工作表,而不一定适用于整个工作簿。
在 VBA 中编写代码相对较新,可能是一个新手错误,但仍然需要一些帮助!
获取运行时错误对象“范围”的方法“值”失败。
这是我拥有的代码,它是整个工作簿中唯一的代码......
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Range("F18")
Case "Made Margin/Made Sales $"
Worksheets("Store #").Range("G18").value =
"Made margin by $XXX GIG at XX.XX%. Shrink at XX.XX% or $XXX. QTD Margin at
XX.XX%"
Case "Made Margin/Missed Sales $"
Worksheets("Store #").Range("G18").value =
"Made margin by $XXX GIG at XX.XX%. Shrink at XX.XX% or $XXX. QTD Margin at XX.XX%
Missed sales by $XXX. Begin explaining Sales $ miss here"
Case "Missed Margin/Made Sales$"
Worksheets("Store #").Range("G18").value = "Missed margin by $XXX GIG at XX.XX%.
Shrink at XX.XX% or $XXX. QTD Margin at XX.XX% Made sales by $XXX. Begin explaining
Margin $ miss here"
Case "Missed Margin/Missed Sales"
Worksheets("Store #").Range("G18").value = "Missed margin by $XXX GIG at XX.XX%.
Shrink at XX.XX% or $XXX. QTD Margin at XX.XX% Begin explaining Margin $ miss here,
followed by explaining Sales $ miss"
End Select
End Sub
任何帮助将不胜感激!