Excel 2013 VBA: x = userform.textbox path

jedwardo

Board Regular
Joined
Aug 21, 2012
Messages
122
Sorry wasn't sure how to label this one. I have multiple textboxes on UserFormMain. Whenever a textbox is selected I'm wanting to make x = the path of the selected textbox on UserFormMain.


For instance when this textbox is selected I'm wanting x = UserFormMain.TextBox1.Value and then show the keyboard.

Code:
Private Sub TextBox1_enter()

[COLOR=#00ff00]''    x = ?[/COLOR]

    UFKeyboard.Show
End Sub


Then this would return the data entered on the keyboard back to the textbox. This is the textbox on UFKeyboard

Code:
Private Sub TextBox1_Change()
x.Value = UFKeyboard.TextBox1.Value
End Sub
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Figured this one out. Used this in the keyboard module:

Code:
Public tField as Variant

This on the userform textboxes:

Code:
Private Sub TextBoxA_Enter()
    tField = ActiveControl.Name
    UFKeyboard.Show
End Sub

Private Sub TextBoxB_Enter()
    tField = ActiveControl.Name
    UFKeyboard.Show
End Sub

And this in the OSK textbox:

Code:
Private Sub TextBox1_Change()
UserFormMain(tField).Value = UFKeyboard.TextBox1.Value
End Sub

On screen keyboard is now triggered when textbox is clicked and data transfers from OSK back to userform textboxes.
 
Upvote 0

Forum statistics

Threads
1,223,969
Messages
6,175,691
Members
452,667
Latest member
vanessavalentino83

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