Microsoft 365 Listbox avec 2 colonnes avec dans la première colonne l'adresse de la cellule

goninph

XLDnaute Nouveau
Bonjour,

Ci-dessous un code de Monsieur Jacques Boisgontier

J'aimerai le modifier pour avoir :
Dans la première colonne l'adresse de la cellule, pour que Private Sub ListBox1_Click() sélectionne la ligne entière correspondante.
Dans la deuxième colonne les valeurs de la colonne ("G3:G" & f.[A65000].End(xlUp).Row)


Merci pour votre aide et belle journée
Philippe

VB:
Option Explicit

Dim f, choix(), choixSA(), Rng

Dim LigneCelluleActive As Long

Private Sub BT_Annuler_Click()

    Unload Me

End Sub

Private Sub TextBox1_Change()

  Dim Mots, Tbl, i, temp

  Mots = Split(sansAccent(Trim(Me.TextBox1)), " ") ' Permet une recherche multiple, taper les requêtes en séparant par un espace

  Tbl = choixSA

  For i = LBound(Mots) To UBound(Mots)

    Tbl = Filter(Tbl, Mots(i), True, vbTextCompare)

  Next i

  Me.ListBox1.List = Tbl

End Sub

Private Sub UserForm_Initialize()

Dim i

  Set f = Sheets("DATA_Interventions")

  Set Rng = f.Range("G3:G" & f.[G65000].End(xlUp).Row) ' Sélectionne toutes les lignes non vide, pas de ligne vide à la fin du formulaire

  choix = Application.Transpose(Rng)

  choixSA = Application.Transpose(Rng)

  For i = 1 To UBound(choixSA)

   choixSA(i) = sansAccent(choixSA(i))

  Next i

  Me.ListBox1.List = choix

  Me.TextBox1.SetFocus 'Place le curseur dans la textbox

End Sub

Private Sub BT_Ajouter_Contact_Click()

        If MsgBox("Inserer un nouveau Contact ?", vbYesNo + vbQuestion, "Contact") = vbYes Then

        Unload Me

            USF_Nouveau_Contact.Show

     End If

End Sub

Private Sub ListBox1_Click()

 

 

Unload Me

End Sub
 

Discussions similaires

Réponses
3
Affichages
533

Statistiques des forums

Discussions
311 725
Messages
2 081 944
Membres
101 849
dernier inscrit
florentMIG