ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting a text box (https://www.excelbanter.com/excel-programming/423638-selecting-text-box.html)

ekreider

Selecting a text box
 
I am wanting to know if there is a way automaticly move to a text box after
selecting a check box or an option button.
example: Click on check box or option buton and the cursor shows up in the
text box automaticly.

Mike H

Selecting a text box
 
Hi,

I assume here weree on a worksheet and lets suppose we have a checkbox and a
textbox. In design mode (I used the control toolbox) right click the checkbox
and view code and enter the code below in

Private Sub CheckBox1_Click()
TextBox1.Activate
End Sub

Go back to the worksheet and exit design mode and click your checkbox.

Mike

"ekreider" wrote:

I am wanting to know if there is a way automaticly move to a text box after
selecting a check box or an option button.
example: Click on check box or option buton and the cursor shows up in the
text box automaticly.


curlydave

Selecting a text box
 
If this is for a UserForm control then this would work

Private Sub CheckBox1_Click()
If CheckBox1 = True Then TextBox1.SetFocus
End Sub
..



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

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