ActiveX Textbox question..please please help....it'll make my work realy easy.

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
I have a text box in excel. I use this to enter a name and click on Ok on other command button...

My question is that i want the enter key to triger my macro when i hit the enter key after i paste the named in the text box.

ANy help will be greatly appriciated.
Thanks alot in advance!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Welcome to the Board!

You could use the TextBox's change event, which will fire as soon as you paste the data in:

<font face=Calibri><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_Change()<br>    MsgBox TextBox1.Value<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,
 
Upvote 0
I think this will work..Thanks alot!
I dont know who you're but thnks alot! great!

So i if I want the macro1 to be trigered when i paste the name from other sheet then i'll have to write Macro1 below MsgBox TextBox1.Value,correct?
 
Upvote 0
and pls tell me this.. can you please make the pop up message that comes up when i paste anything in textbox1?

because whatever i paste there it shows up in text box the same word. Thanks
 
Upvote 0
Welcome to the Board!

You could use the TextBox's change event, which will fire as soon as you paste the data in:

<font face=Calibri><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_Change()<br>    MsgBox TextBox1.Value<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,
Thanks. Please answe my other question
 
Upvote 0
Yes, if you want Macro1 to be triggered in the Change event then you need to call it:

Private Sub TextBox1_Change()
Call Macro1
End Sub


As for the MsgBox, it's doing exactly what I told it to do, which was display the contents of the TextBox - That was merely to show you that it was working. If you don't want a message, just delete it; if you want a message to display something else, then just change "TextBox1.Value" to "Your message here".
 
Upvote 0
This was really simple...i now understand ignorance is bliss..thanks to everyone who helped. Thanks
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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