1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Private Sub CBox_Change()
Dim celluleActive As String, decoupeNom() As String, Act As String
If Me.CBox.Visible = False Then Exit Sub
Debug.Print vbCr
Debug.Print "CBox_Change()"
Debug.Print "ActiveCell.Address: " & ActiveCell.Address
Debug.Print "Me.CBox: " & Me.CBox
On Error Resume Next
celluleActive = ActiveCell.name.name
decoupeNom = Split(celluleActive, "_")
Act = decoupeNom(1)
Debug.Print "Me.CBox <> rien"
Set d1 = CreateObject("Scripting.Dictionary")
tmp = "*" & UCase(Me.CBox) & "*"
For Each c In tblChoix1
If UCase(c) Like tmp Then d1(c) = ""
Next c
Me.CBox.List = d1.Keys
withDropDown = True
Debug.Print "Me.CBox = rien"
Set d1 = Nothing
ActiveCell.Value = Me.CBox
If withDropDown Then Me.CBox.DropDown Else Me.CBox.Activate
Debug.Print "ActiveCell.Value: " & ActiveCell.Value
End Sub |
Partager