ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Issue with listbox not showing the last value in the range (https://www.excelbanter.com/excel-programming/407209-issue-listbox-not-showing-last-value-range.html)

robs3131

Issue with listbox not showing the last value in the range
 
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


--
Robert

JLGWhiz

Issue with listbox not showing the last value in the range
 
You can adust the height property for the listbox which might help. Also,
might try the text align property.

"robs3131" wrote:

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


--
Robert


robs3131

Issue with listbox not showing the last value in the range
 
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.

--
Robert


"JLGWhiz" wrote:

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

"robs3131" wrote:

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


--
Robert



All times are GMT +1. The time now is 08:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com