ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Userform w/ComboBox (https://www.excelbanter.com/excel-discussion-misc-queries/25125-userform-w-combobox.html)

D.Parker

Userform w/ComboBox
 
I have posted this question prior so I thought I would retry. I have created
a Userform that has a Combobox with various pull-down items. Currently the
user can change the default value and when they select a value from the pull
down they can change that also. Is there a way to protect the selections in
the combobox? I tried the locking property but with no success.

Also, I have two selections in the pull-down (they are dashed lines used for
separating groups of options) that I would not like the user to be able to
select. Is there a way to control that also? Thank you.

Kind regards,

D.Parker

Bob Umlas

THere's a Style property setting for comboboxes:
0-fmStyleDropDownCombo
2-fmStyleDropDownList

you want the 2nd one.

You can always check if the value chosen is dashes, and if so, change the
listindex to -1 or some other value, along with a message to the user that
it's not allowed, but you can't prevent him form selecting it in the first
place.

Bob Umlas
Excel MVP

"D.Parker" wrote in message
...
I have posted this question prior so I thought I would retry. I have

created
a Userform that has a Combobox with various pull-down items. Currently

the
user can change the default value and when they select a value from the

pull
down they can change that also. Is there a way to protect the selections

in
the combobox? I tried the locking property but with no success.

Also, I have two selections in the pull-down (they are dashed lines used

for
separating groups of options) that I would not like the user to be able to
select. Is there a way to control that also? Thank you.

Kind regards,

D.Parker




D.Parker

Thank you very much! I will give this a try.

Kind regards,

D.Parker

"Bob Umlas" wrote:

THere's a Style property setting for comboboxes:
0-fmStyleDropDownCombo
2-fmStyleDropDownList

you want the 2nd one.

You can always check if the value chosen is dashes, and if so, change the
listindex to -1 or some other value, along with a message to the user that
it's not allowed, but you can't prevent him form selecting it in the first
place.

Bob Umlas
Excel MVP

"D.Parker" wrote in message
...
I have posted this question prior so I thought I would retry. I have

created
a Userform that has a Combobox with various pull-down items. Currently

the
user can change the default value and when they select a value from the

pull
down they can change that also. Is there a way to protect the selections

in
the combobox? I tried the locking property but with no success.

Also, I have two selections in the pull-down (they are dashed lines used

for
separating groups of options) that I would not like the user to be able to
select. Is there a way to control that also? Thank you.

Kind regards,

D.Parker






All times are GMT +1. The time now is 04:44 PM.

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