Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. Set xWs = Application.ActiveSheet
  2. On Error Resume Next
  3. Set xCombox = xWs.OLEObjects("TempCombo")
  4. With xCombox
  5. .ListFillRange = ""
  6. .LinkedCell = ""
  7. .Visible = False
  8. End With
  9. If Target.Validation.Type = 3 Then
  10. Target.Validation.InCellDropdown = False
  11. Cancel = True
  12. xStr = Target.Validation.Formula1
  13. xStr = Right(xStr, Len(xStr) - 1)
  14. If xStr = "" Then Exit Sub
  15. With xCombox
  16. .Visible = True
  17. .Left = Target.Left
  18. .Top = Target.Top
  19. .Width = Target.Width + 5
  20. .Height = Target.Height + 5
  21. .ListFillRange = xStr
  22. If .ListFillRange = "" Then
  23. xArr = Split(xStr, ",")
  24. Me.TempCombo.List = xArr
  25. End If
  26. .LinkedCell = Target.Address
  27. End With
  28. xCombox.Activate
  29. Me.TempCombo.DropDown
  30. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement