Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation list question Gotroots Excel Discussion (Misc queries) 3 December 9th 09 05:16 PM
List Question metaltecks Excel Discussion (Misc queries) 5 August 17th 06 04:51 PM
Combo box list question tanner g Excel Discussion (Misc queries) 1 April 21st 05 08:59 AM
List Box Question Nick Excel Discussion (Misc queries) 1 March 28th 05 06:42 PM
List box question Michael Bond[_3_] Excel Programming 7 October 15th 03 03:20 PM


All times are GMT +1. The time now is 09:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"