|
本帖最后由 cmo9020 于 2022-12-20 15:08 编辑
ListView1.rar
(51.2 KB, 下载次数: 6)
各位导师晚上好~~~要询问有关.B2栏选择水泥,按下确定之后C2会自动跳出下拉菜单
菜单是SHEET2的水泥栏下(反绿色)
选择车辆就是车辆下面菜单
谢谢各位导师指导一下,谢谢
Private Sub Worksheet_change(ByVal Target As Range)
Dim nL%, d, Arr, i%, m%, t
Set d = CreateObject("scripting.dictionary")
Arr = Sheet2.[a1].CurrentRegion
For i = 2 To UBound(Arr)
d(Arr(i, 1)) = d(Arr(i, 1)) & Arr(i, 2) & ","
Next
nL = Target.Column: m = Target.Row
If Target.Row < 7 Or nL <> 1 Or Target.Count > 1 Then Exit Sub
If d.exists(Target.Value) Then
t = d(Target.Value)
With Cells(m, 2).Validation
.Delete
.Add 3, 1, 1, t
End With
Target.Offset(0, 1).Select
SendKeys "%{down}"
End If
End Sub
|
|