Command Button and Text Box VBA

Makky_05

New Member
Joined
Mar 3, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Hello Everyone ,

I am creating a Userform in which when I select a particular command button, a certain text that I want is entered in the textbox.
I also created another command button2 to remove the text from the text box but am unable to do so.
Can you please help me with the code of removing the text from the textbox when I select command button2?

Any help will be appreciated . Thankyou all in advance.
 

Attachments

  • img2.png
    img2.png
    18.9 KB · Views: 8

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

diddi

Well-known Member
Joined
May 20, 2004
Messages
3,337
Office Version
  1. 2010
Platform
  1. Windows
VBA Code:
TextBox1.Text=""
DoEvents
 

Makky_05

New Member
Joined
Mar 3, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Thankyou so much for replying back to me . Very much appreciated.
 

Makky_05

New Member
Joined
Mar 3, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
VBA Code:
TextBox1.Text=""
DoEvents
When I applied this code my other command button which allows text to appear in text box do not work .I want both my command buttons to work- 1. that will put the text in text box 2. One that will remove the text from the text box.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,139
Messages
5,835,627
Members
430,372
Latest member
contentment

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
Top