Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
List Box Question
Good morning, all !
I have a user form with a list box. The contents of the list box change according to the range name shown in the row source property. When I run the user form, the contents of the list box do change as I want them to, but no "default" item is selected. I'd like the first item to be selected each time the contents of the list box changes, but I don't know how to do this. Your help is appreciated. Thanks !! Jeff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
List Box Question
Hi Jeff,
You could try ListBox1.ListIndex = 1 The "1" referes to the first item in your list. Regards, Peter "Jeff Wright" schreef in bericht news:2lzZe.267314$E95.61233@fed1read01... Good morning, all ! I have a user form with a list box. The contents of the list box change according to the range name shown in the row source property. When I run the user form, the contents of the list box do change as I want them to, but no "default" item is selected. I'd like the first item to be selected each time the contents of the list box changes, but I don't know how to do this. Your help is appreciated. Thanks !! Jeff |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
List Box Question
The "1" referes to the first item in your list.
The ListIndex property is 0 based. The first item in the list is ListIndex = 0, and the last item is ListIndex = ListCount -1. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter" wrote in message ... Hi Jeff, You could try ListBox1.ListIndex = 1 The "1" referes to the first item in your list. Regards, Peter "Jeff Wright" schreef in bericht news:2lzZe.267314$E95.61233@fed1read01... Good morning, all ! I have a user form with a list box. The contents of the list box change according to the range name shown in the row source property. When I run the user form, the contents of the list box do change as I want them to, but no "default" item is selected. I'd like the first item to be selected each time the contents of the list box changes, but I don't know how to do this. Your help is appreciated. Thanks !! Jeff |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
List Box Question
Peter,
I did try it, and it works! Thanks for much for your help on this! Jeff "Peter" wrote in message ... Hi Jeff, You could try ListBox1.ListIndex = 1 The "1" referes to the first item in your list. Regards, Peter "Jeff Wright" schreef in bericht news:2lzZe.267314$E95.61233@fed1read01... Good morning, all ! I have a user form with a list box. The contents of the list box change according to the range name shown in the row source property. When I run the user form, the contents of the list box do change as I want them to, but no "default" item is selected. I'd like the first item to be selected each time the contents of the list box changes, but I don't know how to do this. Your help is appreciated. Thanks !! Jeff |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
List Box Question
Chip, yes, after experimenting with it, I discovered that it is zero-based.
Thanks, Jeff "Chip Pearson" wrote in message ... The "1" referes to the first item in your list. The ListIndex property is 0 based. The first item in the list is ListIndex = 0, and the last item is ListIndex = ListCount -1. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Peter" wrote in message ... Hi Jeff, You could try ListBox1.ListIndex = 1 The "1" referes to the first item in your list. Regards, Peter "Jeff Wright" schreef in bericht news:2lzZe.267314$E95.61233@fed1read01... Good morning, all ! I have a user form with a list box. The contents of the list box change according to the range name shown in the row source property. When I run the user form, the contents of the list box do change as I want them to, but no "default" item is selected. I'd like the first item to be selected each time the contents of the list box changes, but I don't know how to do this. Your help is appreciated. Thanks !! Jeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Validation list question | Excel Discussion (Misc queries) | |||
List Question | Excel Discussion (Misc queries) | |||
Combo box list question | Excel Discussion (Misc queries) | |||
List Box Question | Excel Discussion (Misc queries) | |||
List box question | Excel Programming |