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: 9

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Thankyou so much for replying back to me . Very much appreciated.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,999
Members
448,543
Latest member
MartinLarkin

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