insertion commentaire d'une celulle dans 1 listbox

chris541

XLDnaute Junior
Bonjour au forum

Voilà je cherche comment insérer un commentaire d'une cellule vers la List box
J'ai préparé le fichier
Merci pour votre aide:rolleyes:
Chris
 

Pièces jointes

  • TEST commentaire.xlsm
    26.1 KB · Affichages: 46
  • TEST commentaire.xlsm
    26.1 KB · Affichages: 53
  • TEST commentaire.xlsm
    26.1 KB · Affichages: 50

Pierrot93

XLDnaute Barbatruc
Re : insertion commentaire d'une celulle dans 1 listbox

Bonjour,

essaye peut être ceci :
Code:
Option Explicit
Private Sub ComboBox1_Change()
Dim i As Integer, m As Byte
   If ComboBox1.ListIndex = -1 Or ComboBox2.ListIndex = -1 Then Exit Sub
   m = ComboBox2.ListIndex * 2 + 2
   ListBox1.Clear
   TextBox2 = ""
   For i = 4 To 8
       If Cells(i, m).Text Like "*" & ComboBox1.Value & "*" Then
            If Cells(i, m).Comment Is Nothing Then
                ListBox1.AddItem Cells(i, m).Text & " " & Cells(i, m).Offset(0, 1)
            Else
                ListBox1.AddItem Cells(i, m).Text & " " & Cells(i, m).Comment.Text & " " & Cells(i, m).Offset(0, 1)
            End If
           TextBox2 = Val(TextBox2) + Val(Cells(i, m))
       End If
   Next i
End Sub

bon après midi
@+
 

Discussions similaires

Réponses
4
Affichages
322

Statistiques des forums

Discussions
312 493
Messages
2 088 959
Membres
103 990
dernier inscrit
lamiadebz