Correction de macro recherche multi critére

Suite à une modification du classeur, la feuille " liste des clients " ne se trouve plus dans ce classeur mais dans un autre classeur qui se trouve dans un fichier " clientèles ", que dois je faire pour que la macro fonctionne. Merci

Dim a()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  If Not Intersect([E7:Q8], Target) Is Nothing Then              'And Target.Count = 1 Then
    a = Application.Transpose(Sheets("Liste des clients").Range("A2:A1000").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.Cells(1, 1)
    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
  Else
    ActiveCell = Me.ComboBox1
  End If
End Sub
Private Sub ComboBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
  Me.ComboBox1.List = a
  Me.ComboBox1.Activate
  Me.ComboBox1.DropDown
End Sub
Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  If KeyCode = 13 Then ActiveCell.Offset(1).Select
End Sub

up

bonsoir, change le nom dans le code :

"Liste des clients"

bonne soirée

et je mets quoi a la place ?

    Dim a()
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
      If Not Intersect([E7:Q8], Target) Is Nothing Then              'And Target.Count = 1 Then
       a = Application.Transpose(Sheets("Nom de ton onglet").Range("A2:A1000").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.Cells(1, 1)
        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
      Else
        ActiveCell = Me.ComboBox1
      End If
    End Sub
    Private Sub ComboBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
      Me.ComboBox1.List = a
      Me.ComboBox1.Activate
      Me.ComboBox1.DropDown
    End Sub
    Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
      If KeyCode = 13 Then ActiveCell.Offset(1).Select
    End Sub

A la place de liste fichier clients met le nouveau nom de ton onglet qui contient les données entre les "" ton onglet" dans le code en ligne 4.

Sous reserve que tes données soit disposer pareil.

@+

mon onglet n'a pas changé de nom ( Liste des clients) c'est juste qu'il est dans un autre classeur

re, alors recopie cette macro dans ton classeur listes clients car excel ne connait pas le chemin de ton fichier.

Rechercher des sujets similaires à "correction macro recherche multi critere"