Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. Sub DropDown14_Change()
  2. Dim ScCell As Range, key
  3. Dim Dic As Object: Set Dic = CreateObject("Scripting.Dictionary")
  4. Set ws = Worksheets("Dashboard")
  5. Set wsD = Worksheets("DATA")
  6. Set complistDict = CreateObject("Scripting.Dictionary")
  7. Dim DD14V As Variant
  8.  
  9.  
  10.  
  11. complistDict.RemoveAll
  12. Dim DD14 As Object
  13. Set complistDict = Nothing
  14. Set complistDict = CreateObject("scripting.dictionary")
  15.  
  16. ws.Shapes("Drop Down 16").ControlFormat.RemoveAllItems
  17.  
  18. Set DD14 = ws.Shapes("Drop Down 14").OLEFormat.Object
  19. Set DD16 = ws.Shapes("Drop Down 16").OLEFormat.Object
  20. DD14V = DD14.List(DD14.Value)
  21.  
  22. 'ws.dropdown14.Clear
  23. For Each ScCell In wsD.Range("E2", wsD.Cells(Rows.Count, "E").End(xlUp))
  24. Dic.CompareMode = vbTextCompare
  25. If ScCell.Value = DD14V Then
  26. If Not Dic.Exists(LCase(rCell.Offset(, -1).Value)) Then
  27. Dic.Add LCase(rCell.Offset(, -1).Value), Nothing
  28.  
  29. End If
  30.  
  31. End If
  32. Next ScCell
  33. 'MsgBox DD14.List(DD14.ListIndex)
  34.  
  35. For Each key In Dic
  36. DD16.AddItem key
  37. Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement