Zone de listing .ComboBox1

bonjour

j'essaie d'adapter le code très bien fait de http://boisgontierjacques.free.fr

ca marche tres bien sur la colonne C mais je n'arrive pas à faire la meme chose sur la colonne B

je cherche depuis 1h mais pas trouvé.si vous avez une idée ce sera génial .merci d'avance

il y a un fichier joint en bas dans onglet test

 Dim a()
Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

  If Not Intersect([b2:b160], Target) Is Nothing And Target.Count = 1 Then
  Set plage_v = Sheets("volt").Range("volt")
'ActiveSheet.Range ("b2:b" & [b65000].End(xlUp).Row)
    a = Application.Transpose(plage_v)
    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    ' ouverture automatique au clic dans la cellule (optionel)
  Else
    Me.ComboBox1.Visible = False
  End If
If Not Intersect([c2:c160], Target) Is Nothing And Target.Count = 1 Then
  Set plage_c = Sheets("volt").Range("conn")
'ActiveSheet.Range ("b2:b" & [b65000].End(xlUp).Row)
    a = Application.Transpose(plage_c)
    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    ' ouverture automatique au clic dans la cellule (optionel)
  Else
    Me.ComboBox1.Visible = False
  End If
End Sub
Private Sub ComboBox1_Change()
 If Me.ComboBox1 <> "" And IsError(Application.Match(Me.ComboBox1, a, 0)) Then
   Me.ComboBox1.List = Filter(a, Me.ComboBox1.Text, True, vbTextCompare)
   Me.ComboBox1.DropDown
 End If
   ActiveCell.Value = Me.ComboBox1
End Sub

Private Sub ComboBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
  Me.ComboBox1.List = a
  Me.ComboBox1.Activate
  Me.ComboBox1.DropDown
End Sub
17test.xlsm (47.81 Ko)

personne n'a une idée ?

Rechercher des sujets similaires à "zone listing combobox1"