Issue with listbox not showing the last value in the range

R

robs3131

Hi all,

This one is leaving laughing in utter frustration and delirium (have been
spending a LOT of time lately in VBA trying to finish my project... :)

The issue is that the last value in my range that is being pulled into a
listbox in a form is not showing in the listbox. I can see just the very
very top of the text of the last value in the listbox, however, for some
reason, the listbox will not scroll down to that last value. It's very odd
-- the scroller on the listbox shows just a tad of space between the current
position and the end, but it won't let me scroll to the end.

I have increased my range to include a blank cell -- this allows the last
value to show -- however, I'm wondering why the heck this is happening.
Thanks! Code is below:

Formula in sheet for specified range (under "Insert" - "Name" -- note that
this is the formula which results in the last cell in the range not showing
in the listbox):
=OFFSET('Commdet formulas'!$BA$1,0,0,COUNTA('Commdet formulas'!$BA:$BA),1)
---------
Code of form initialization:
Private Sub UserForm_Initialize()

'Sheets("Commdet formulas").Activate
With lstmissingids
'populate listbox with appropriate values
.RowSource = Range("txtmissing").Address
End With

End Sub
-------
Code of formatting of form:
With frmmissingent
.Show vbModeless
.Caption = "Open Sales transactions"
.lstmissingids.Top = 198
.lstmissingids.Height = 100.5
.cmdcopylbl.Top = 312
.cmdcopy.Top = 312
.cmdclose.Top = 312
.lblmissingent.Height = 180
.Height = 380
End With
 
J

JLGWhiz

You can adust the height property for the listbox which might help. Also,
might try the text align property.
 
R

robs3131

I tried adjusting the height and the textalign property...neither worked.
The scroll bar literally shows that theres a little space left, implying
there's another record, it just won't let me scroll down.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top