asyamonique
Well-known Member
- Joined
- Jan 29, 2008
- Messages
- 1,286
- Office Version
- 2013
- Platform
- Windows
Code:
Private Sub ListBox1_Click()
With Me.ListBox1
Me.TextBox21.Value = .list(.ListCount - 20, 0)
Me.TextBox22.Value = .list(.ListCount - 19, 0)
Me.TextBox23.Value = .list(.ListCount - 18, 0)
Me.TextBox24.Value = .list(.ListCount - 17, 0)
Me.TextBox5.Value = .list(.ListCount - 16, 0)
Me.TextBox6.Value = .list(.ListCount - 15, 0)
Me.TextBox7.Value = .list(.ListCount - 14, 0)
Me.TextBox8.Value = .list(.ListCount - 13, 0)
Me.TextBox9.Value = .list(.ListCount - 12, 0)
Me.TextBox10.Value = .list(.ListCount - 11, 0)
Me.TextBox11.Value = .list(.ListCount - 10, 0)
Me.TextBox12.Value = .list(.ListCount - 9, 0)
Me.TextBox13.Value = .list(.ListCount - 8, 0)
Me.TextBox14.Value = .list(.ListCount - 7, 0)
Me.TextBox15.Value = .list(.ListCount - 6, 0)
Me.TextBox16.Value = .list(.ListCount - 5, 0)
Me.TextBox17.Value = .list(.ListCount - 4, 0)
Me.TextBox18.Value = .list(.ListCount - 3, 0)
Me.TextBox19.Value = .list(.ListCount - 2, 0)
Me.TextBox20.Value = .list(.ListCount - 1, 0)
End With
End Sub
Good Day
Is there any way to alter that given code.
If the list index has 20rows and above it works fine.
But if the row amount reduce giving me the below error...
Run-time error ‘381’:
“Could not get the List property.Invalid property array index.”
How can i avoid that error?
Many Thanks