ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ListBox display bug (https://www.excelbanter.com/excel-programming/346388-listbox-display-bug.html)

Ben

ListBox display bug
 
Hi,
I am using a listBox filled using ListFillRange.
However, when I open the spreadsheet, the LB appears as blank, I need to
scroll down and then up to refresh the display
Any trick to force the listbox to refresh its appearance?
Thanks
ben

Leith Ross[_320_]

ListBox display bug
 

Hello Ben,

You can display any item in list by setting the ListIndex property.

EXAMPLE:

Shapes("Drop Down 11").ControlFormat.ListIndex = 1

This displays the first item in the list. The numbering begins at 1.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=487543


chijanzen

ListBox display bug
 
Ben:

add this code to Thisworkbook Module

'Thisworkbook
Private Sub Workbook_Open()
Sheet1.Shapes("Listbox1").DrawingObject.Object.Top Index = 0
End Sub


Control Toolbox Controls
--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Ben" wrote:

Hi,
I am using a listBox filled using ListFillRange.
However, when I open the spreadsheet, the LB appears as blank, I need to
scroll down and then up to refresh the display
Any trick to force the listbox to refresh its appearance?
Thanks
ben


Ben

ListBox display bug
 
This still doesn't make it. Will try to play around.
It has something to do with the screen not refreshing the display of the
listbox control.
Anyway to programmatically control the scrollbar on a listbox? (as clicking
on the control itself and scrolling down an up refresh the list)

Thanks guys

"chijanzen" wrote:

Ben:

add this code to Thisworkbook Module

'Thisworkbook
Private Sub Workbook_Open()
Sheet1.Shapes("Listbox1").DrawingObject.Object.Top Index = 0
End Sub


Control Toolbox Controls
--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Ben" wrote:

Hi,
I am using a listBox filled using ListFillRange.
However, when I open the spreadsheet, the LB appears as blank, I need to
scroll down and then up to refresh the display
Any trick to force the listbox to refresh its appearance?
Thanks
ben


chijanzen

ListBox display bug
 
Ben:

Use ListIndex property

Sheet1.ListBox1.ListIndex =2
--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Ben" wrote:

This still doesn't make it. Will try to play around.
It has something to do with the screen not refreshing the display of the
listbox control.
Anyway to programmatically control the scrollbar on a listbox? (as clicking
on the control itself and scrolling down an up refresh the list)

Thanks guys

"chijanzen" wrote:

Ben:

add this code to Thisworkbook Module

'Thisworkbook
Private Sub Workbook_Open()
Sheet1.Shapes("Listbox1").DrawingObject.Object.Top Index = 0
End Sub


Control Toolbox Controls
--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Ben" wrote:

Hi,
I am using a listBox filled using ListFillRange.
However, when I open the spreadsheet, the LB appears as blank, I need to
scroll down and then up to refresh the display
Any trick to force the listbox to refresh its appearance?
Thanks
ben



All times are GMT +1. The time now is 05:42 PM.

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