ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   listbox option in form (https://www.excelbanter.com/excel-programming/294375-listbox-option-form.html)

inquirer

listbox option in form
 
I have a form in excel vb which has a listbox with alternatives option1 and
option2.
Option1 is the default. If option2 is selected I would like to put up a
additional textbox and label on the same form asking for further
information via the textbox. (This textbox and label should not appear when
the form is first opened.)

Is it possible to do this? If so how?

TIA
Chris




Patrick Molloy

listbox option in form
 
Place the text box on the form and set its visible property to false.
In the option button's change event set the text box visible property to the
value of the option

Private Sub OptionButton2_Change()
TextBox1.Visible = OptionButton2.Value
Label1.Visible= OptionButton2.Value
End Sub
--
Patrick Molloy
Microsoft Excel MVP

"inquirer" wrote in message
...
I have a form in excel vb which has a listbox with alternatives option1

and
option2.
Option1 is the default. If option2 is selected I would like to put up a
additional textbox and label on the same form asking for further
information via the textbox. (This textbox and label should not appear

when
the form is first opened.)

Is it possible to do this? If so how?

TIA
Chris






inquirer

listbox option in form
 
Thanks Patrick, that's what I needed
Chris

"Patrick Molloy" wrote in message
...
Place the text box on the form and set its visible property to false.
In the option button's change event set the text box visible property to

the
value of the option

Private Sub OptionButton2_Change()
TextBox1.Visible = OptionButton2.Value
Label1.Visible= OptionButton2.Value
End Sub
--
Patrick Molloy
Microsoft Excel MVP

"inquirer" wrote in message
...
I have a form in excel vb which has a listbox with alternatives option1

and
option2.
Option1 is the default. If option2 is selected I would like to put up a
additional textbox and label on the same form asking for further
information via the textbox. (This textbox and label should not appear

when
the form is first opened.)

Is it possible to do this? If so how?

TIA
Chris









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

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