Private Sub CommandButton1_Click()
With cbComboBox
If .ListIndex > -1 Then
'il faut index de Colonnes 0 et 1 et Non 1 et 2
MsgBox .List(.ListIndex, 0) 'La numérotation des colonnes commence à 0
MsgBox .List(.ListIndex, 1)
End If
End With
End Sub
Private Sub UserForm_Initialize()
Dim DerCell As String, NbLigneUtilisée
Dim Cell As Range
Label1 = ""
Label1.BackColor = cbComboBox.BackColor
DerCell = Range("A1").End(xlDown).Row
With Sheets("Feuil1")
For Each Cell In .Range("A2:A" & .Range("A1").End(xlDown).Row)
Me.cbComboBox.AddItem
Me.cbComboBox.List(NbLigneUtilisée, 0) = Cell
Me.cbComboBox.List(NbLigneUtilisée, 1) = Cell.Offset(0, 1)
NbLigneUtilisée = NbLigneUtilisée + 1
Next
End With
End Sub