Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'
Dim MesCellules As Range
Dim Cbx As msforms.ComboBox
On Error Resume Next
Set Cbx = Me.Shapes("Cbx").OLEFormat.Object.Object
If Err Then
ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Link:=False, _
DisplayAsIcon:=False, Left:=1, Top:=1, Width:=1, Height:=1).Name = "Cbx"
Set Cbx = Me.Shapes("Cbx1").OLEFormat.Object.Object
End If
On Error GoTo 0
Set MesCellules = Range("b34,f34,j34,n34,r34")
With Cbx
.Visible = False
If Not Intersect(Target, MesCellules) Is Nothing And Target.Count = 1 Then
.LinkedCell = Target.Address
.List = Sheets("BD").Range("listeVilles").Value
.Height = Target.Height + 1
.Width = Target.Width + 2
.Top = Target.Top
.Left = Target.Left
.Value = Target
.Activate
.Visible = True
.DropDown ' ouverture automatique au clic dans la cellule
End If
End With
End Sub