LISTBOX'S

  • Thread starter Thread starter GREGORY
  • Start date Start date
G

GREGORY

hello

3 things

is it possible to sort the contents of a listbox
is it possible to prevent items in a listbox being selected

can you add items to a label in the same way as a listbox


many thanks
Greg
 
Greg,
is it possible to sort the contents of a listbox

There is no built-in way to sort a list box.
is it possible to prevent items in a listbox being selected

You can disable the entire list box with
ListBox1.Enabled = False
but you cannot disable individual items in the list.
can you add items to a label in the same way as a listbox

I'm not sure what you mean, but I think the answer would be "no".

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
ok thank you.
-----Original Message-----
Greg,


There is no built-in way to sort a list box.
selected

You can disable the entire list box with
ListBox1.Enabled = False
but you cannot disable individual items in the list.
listbox

I'm not sure what you mean, but I think the answer would be "no".

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com






.
 
-----Original Message-----
ok thank you.

BUT
You can simulate by changing the data content as required
1.January
2.February etc

You could do 2 things
Reload the list box with the items that you want enabled
OR
Do something like (I have just implemented this)
Preceed the item with * and if selected pop up with a
message saying 'Items beginning * cannot be selected'
perhaps a bit problematic with multiple selections but
just reject all of them and get the user to start again
Unless you want the label to be conditional upon something
else. AS you cannot go to a dropdown label it sounds like
you just want to change the label. Just program it in by
changing the caption depending on what is required. Labels
cannot be selected by users so it has to be done
programmatically
 
Back
Top