Paramétrer Cellules d'une Liste Déroulante Intuitif code VBA
Bonjour,
Dans le code ci-dessous, [emprunté sur le très bon site de Jacques Boisgontier: (http://boisgontierjacques.free.fr/) et qui fonctionne très bien] je voudrais pouvoir paramétrer les cellules Ax:Ay de telle sorte que si j'intercale des lignes supplémentaires dans le tableau je n'ai pas besoin de modifier le code VBA.
Existe-t-il une solution?
Merci
--------------------
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect([Ax:Ay], Target) Is Nothing And Target.Count = 1 Then
a = Application.Transpose(Sheets("Feuille1").Range("Donnees").Value)
Me.ComboBox1.List = a
Me.ComboBox1.Height = Target.Height + 3
Me.ComboBox1.Width = Target.Width
Me.ComboBox1.Top = Target.Top
Me.ComboBox1.Left = Target.Left
Me.ComboBox1 = Target
Me.ComboBox1.Visible = True
Me.ComboBox1.Activate
Me.ComboBox1.DropDown
Else
Me.ComboBox1.Visible = False
End If
End Sub |
----------------------