Saisie auto sur liste automatique

jlzcaps238

XLDnaute Nouveau
Bonjour,

Je souhaiterais que la liste déroulante dans la colonne G intitulé CHAUFFEUR REMPLACER du 1er tableau soit en saisie auto car il y a trop de noms dans la liste déroulante.

La liste des conducteurs se trouvent dans la colonne R.

Si quelqu'un pourrait m'aider car je galère malgré tous les question du même sujet déjà abordé sur le forum.

Cdt.

Julien.
 

Pièces jointes

  • PLANNIFICATION.xls
    122 KB · Affichages: 30
  • PLANNIFICATION.xls
    122 KB · Affichages: 27
  • PLANNIFICATION.xls
    122 KB · Affichages: 27

BOISGONTIER

XLDnaute Barbatruc
Repose en paix
Re : Saisie auto sur liste automatique

Bonjour,

Planification (version1):


=DECALER(CONDUCTEURS;EQUIV(G5&"*";CONDUCTEURS;0)-1;;NB.SI(CONDUCTEURS;G5&"*"))

Frapper les premières puis cliquer sur la flèche

Planification2: avec formulaire (version2)

Frapper les premières lettres:les noms apparaissent au fur et à mesure de la frappe des lettres (saisie intuitive)

Code:
Dim a()
Private Sub UserForm_Initialize()
  a = [conducteurs].Value
  Me.ComboBox1.List = a
  Me.ComboBox1.SetFocus
  SendKeys "{f4}"
End Sub

Private Sub ComboBox1_Change()
  Set d1 = CreateObject("Scripting.Dictionary")
  tmp = UCase(Me.ComboBox1) & "*"
  For Each c In a
    If UCase(c) Like tmp Then d1(c) = ""
  Next c
  Me.ComboBox1.List = d1.keys
  Me.ComboBox1.DropDown
End Sub

Private Sub CommandButton1_Click()
  ActiveCell = Me.ComboBox1
  Unload Me
End Sub

Planification3: avec ComboBox intégré dans la feuille (version3)

Frapper les premières lettres:les noms apparaissent au fur et à mesure de la frappe des lettres (saisie intuitive)

Code:
Dim a()
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  If Not Intersect([G5:G40], Target) Is Nothing And Target.Count = 1 Then
    a = Sheets("modèle").Range("conducteurs").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

Private Sub ComboBox1_Change()
 If Me.ComboBox1 <> "" Then
   Set d1 = CreateObject("Scripting.Dictionary")
   tmp = UCase(Me.ComboBox1) & "*"
   For Each c In a
     If UCase(c) Like tmp Then d1(c) = ""
   Next c
   Me.ComboBox1.List = d1.keys
   Me.ComboBox1.DropDown
   [e2] = Me.ComboBox1
 End If
   ActiveCell.Value = Me.ComboBox1
End Sub

Img1.gif

JB
 

Pièces jointes

  • PLANNIFICATION.xls
    115.5 KB · Affichages: 29
  • PLANNIFICATION.xls
    115.5 KB · Affichages: 30
  • PLANNIFICATION.xls
    115.5 KB · Affichages: 31
  • PLANNIFICATION2.xls
    131 KB · Affichages: 42
  • PLANNIFICATION3.xls
    131.5 KB · Affichages: 35
Dernière édition:

Discussions similaires

Réponses
22
Affichages
2 K