ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   LISTBOX'S (https://www.excelbanter.com/excel-programming/283985-listboxs.html)

GREGORY

LISTBOX'S
 
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


Chip Pearson

LISTBOX'S
 
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



"GREGORY" wrote in message
...
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




GREGORY

LISTBOX'S
 
ok thank you.
-----Original Message-----
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



"GREGORY" wrote in

message
...
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



.


Malcolm

LISTBOX'S
 

-----Original Message-----
ok thank you.
-----Original Message-----
Greg,

is it possible to sort the contents of a listbox


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


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


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.


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

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".

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

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



"GREGORY" wrote in

message
...
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



.

.



All times are GMT +1. The time now is 09:37 AM.

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