ListBox1_Click(How to simplify code)
I use it like this
>>> as You've noted <<<
>>> use code - tags <<<
I use it like this
>>> as You've noted <<<
>>> use code - tags <<<
Code:
Private Sub ListBox1_Click()
I have more than 9 textboxes
TextBox1 = ListBox1.List(ListBox1.ListIndex, 0) '1ª COLUMN
TextBox2 = ListBox1.List(ListBox1.ListIndex, 1) '2ª COLUMN
TextBox3 = ListBox1.List(ListBox1.ListIndex, 2) '3ª COLUMN
TextBox10 = ListBox1.List(ListBox1.ListIndex, 9) '10ª COLUMN
TextBox11 = ListBox1.List(ListBox1.ListIndex, 10) '11ª COLUMN
End Sub
'How to simplify
Private Sub ListBox1_Click()
'You can change it to greater than 9
For K = 0 To 9
Me("Textbox" & K) = ListBox1.Column(K)
Next
End Sub
Last edited by a moderator: