ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If Then Combobox (https://www.excelbanter.com/excel-programming/427152-if-then-combobox.html)

Bishop

If Then Combobox
 
I have a combobox (rating) with the following list "G, PG, PG-13, R, NC-17,
X, NR". I want to be able to do the following: tab to rating, then
if "g" then select G and tab
if "p" then select PG and tab
if "3" then select PG-13 and tab
if "r" then select R and tab
if "7" then select NC-17 and tab
if "x" then select X and tab
if "n" then select NR and tab
where "g" means I press the g key, etc, and tab means whenever I select the
appropriate key the corresponding selection is made and automatically tabs to
the next combobox.

Jacob Skaria

If Then Combobox
 
Try using a select statement within the Keypress event of the Combobox.
Within each case set the Listindex of the Combobox to match the value.

If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

I have a combobox (rating) with the following list "G, PG, PG-13, R, NC-17,
X, NR". I want to be able to do the following: tab to rating, then
if "g" then select G and tab
if "p" then select PG and tab
if "3" then select PG-13 and tab
if "r" then select R and tab
if "7" then select NC-17 and tab
if "x" then select X and tab
if "n" then select NR and tab
where "g" means I press the g key, etc, and tab means whenever I select the
appropriate key the corresponding selection is made and automatically tabs to
the next combobox.


Bishop

If Then Combobox
 
I'm sorry but I don't know what a "select statement", "Keypress event"
is/does. And I'm still a little fuzzy on what "Listindex" does or where it
is. Can you be more descriptive? Maybe give me an example?

"Jacob Skaria" wrote:

Try using a select statement within the Keypress event of the Combobox.
Within each case set the Listindex of the Combobox to match the value.

If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

I have a combobox (rating) with the following list "G, PG, PG-13, R, NC-17,
X, NR". I want to be able to do the following: tab to rating, then
if "g" then select G and tab
if "p" then select PG and tab
if "3" then select PG-13 and tab
if "r" then select R and tab
if "7" then select NC-17 and tab
if "x" then select X and tab
if "n" then select NR and tab
where "g" means I press the g key, etc, and tab means whenever I select the
appropriate key the corresponding selection is made and automatically tabs to
the next combobox.



All times are GMT +1. The time now is 01:25 AM.

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