I'd be interested to know if anyone else has experience of this
problem, and if there is any workaround:
Insert a UserForm
Draw a listbox called ListBox1
Paste the following code:
Private Sub UserForm_Initialize()
ListBox1.Top = 0
ListBox1.AddItem "ListLine"
ListBox1.AddItem "ListLine"
ListBox1.AddItem "ListLine"
ListBox1.AddItem "ListLine"
ListBox1.AddItem "ListLine"
ListBox1.AddItem "LAST LINE"
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift
As Integer, ByVal X As Single, ByVal Y As Single)
If Button <> 1 Then Exit Sub
ListBox1.Height = Y
End Sub
Now run the form and resize the listbox by clicking on the form
background until the last item is not visible, and the scroll bar
appears.
Scrolling down does not scroll to the last line!
The following code resolves the scrolling, but changes the height of
the listbox which is no good:
Private Sub UserForm_MouseUp(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
ListBox1.IntegralHeight = False
ListBox1.IntegralHeight = True
End Sub
I realise that I'm being a bit obstinate to insist on a completely
variable listbox height, but it is appropriate in this instance!