Question for Excel Experts!!

tv9_rohith

Board Regular
Joined
Sep 1, 2011
Messages
96
I have created form in excel

with text box and the command Buttons.

and now I want to activate the tab key for this so that after entering the data in Text box and click on Tab Button on Keyboard then the command button should get select and then when I click on the enter button then the Query should execute.

It nothing but ignore mouse clicks we should be able to navigate from text box to command button with keyboard.

Thanks,
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
What does happen when you press Tab in the text box. If the .TabKeyBehaviour is False, focus should pass to the next control in the tab order.

Also, if the .Default property of a Command Button is True, then pressing Return should activate that command button's click event.

Putting this in the Intialize event should set all that up for the userform.

Code:
Private Sub UserForm_Initialize()
    TextBox1.TabIndex = 0
    TextBox1.TabKeyBehavior = False
    CommandButton1.TabIndex = 1
    CommandButton1.Default = True
End Sub
 
Upvote 0
sorry to say that but I am not able to see any result.

My excel is as below :

in sheet 1 I hve 1 Text box to enter the values and then command button to excute and textbox 2 for displaying result and one more command button for clear the values.

if possible could you please tell manual steps on how to do that
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,331
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top