marc.gilliand
XLDnaute Occasionnel
Bonsoir,
J'ai un listbox avec 8 colonnes, j'aimerai que certaines soient "à gauche", d'autres à "droite".
Voici mon bout de code :
Private Sub UserForm_Initialize()
'taille formulaire
UserForm1.Height = 505
UserForm1.Width = 960
'initialisation formulaire
ListBox1.ColumnCount = 8
ListBox1.List = Sheets("ListePaiements").Range("A1:K10000").Value
End Sub
Private Sub ListBox1_Change()
On Error Resume Next
Dim strCol1 As String
Dim TextRow As Long
TextRow = ListBox1.ListIndex
On Error Resume Next
strCol1 = ListBox1.List(TextRow, 0)
Sheets("USF1").Cells(16, 2).Value = strCol1
Me.TextBox2.Value = Sheets("USF1").Cells(4, 2).Value
Me.TextBox12.Value = Sheets("USF1").Cells(18, 2).Value
Me.TextBox10.Value = Sheets("USF1").Cells(19, 2).Value
Me.TextBox9.Value = Sheets("USF1").Cells(20, 2).Value
Me.TextBox28.Value = Sheets("USF1").Cells(21, 2).Value
Me.TextBox11.Value = Sheets("USF1").Cells(22, 2).Value
End Sub
merci de votre aide
J'ai un listbox avec 8 colonnes, j'aimerai que certaines soient "à gauche", d'autres à "droite".
Voici mon bout de code :
Private Sub UserForm_Initialize()
'taille formulaire
UserForm1.Height = 505
UserForm1.Width = 960
'initialisation formulaire
ListBox1.ColumnCount = 8
ListBox1.List = Sheets("ListePaiements").Range("A1:K10000").Value
End Sub
Private Sub ListBox1_Change()
On Error Resume Next
Dim strCol1 As String
Dim TextRow As Long
TextRow = ListBox1.ListIndex
On Error Resume Next
strCol1 = ListBox1.List(TextRow, 0)
Sheets("USF1").Cells(16, 2).Value = strCol1
Me.TextBox2.Value = Sheets("USF1").Cells(4, 2).Value
Me.TextBox12.Value = Sheets("USF1").Cells(18, 2).Value
Me.TextBox10.Value = Sheets("USF1").Cells(19, 2).Value
Me.TextBox9.Value = Sheets("USF1").Cells(20, 2).Value
Me.TextBox28.Value = Sheets("USF1").Cells(21, 2).Value
Me.TextBox11.Value = Sheets("USF1").Cells(22, 2).Value
End Sub
merci de votre aide