我之前已经实现了基于选择在我的工作表中插入多选 ListBox
的代码。
我想添加更多条件以添加ListBox
如果在同一行中选择Column 7
并且具有字符串Column 2
"variable"
。
伪代码:
If activeCell.Column = 7 and if activeCell intersection with Column 2 contains the string "variable" then
Add multi-select ListBox below active cell and
Output selections to activeCell.
这是我目前使用的代码的一部分。它将 ListBox
添加到指定列中的每一行,而不是添加到指定列中的限定行。
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target,ColourArea(activeSheet)) Is Nothing Then
CreateColourPopUp Target
Else
DeleteAllPopUps Target
End If
End Sub
如何添加上面提到的额外条件?