Search for words in userform textbox

JeremySun

Board Regular
Joined
Jul 1, 2011
Messages
98
Is there a way to write a VBA that will search a Userform text box for several words, then if a word from the list is in the textbox a message will open up? I have no idea on how to code this. Thank you in advance.
 
I have tried to add a module to the userform and I am getting an error of Invalid use of Me keyword

You don't add a module to a userform. The userform has a ready to use module by default.

What you do is :

1- Press Alt+F11 to get to to the VB environement.
2- Insert > UseForm from the Main menu.
3- Insert a commandbutton and a textbox from the Controls toolbox. (this will give you CommenadButton1 and TextBox1 by default.)
4- DoubleClick the UserForm to get to the Form Module.
5- Delete any code you find in the Form module white pane.
6- Place the code in my previous post in the form module.
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,224,597
Messages
6,179,812
Members
452,945
Latest member
Bib195

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