VBA to remove last to characters from string in a textbox

OfficeUser

Well-known Member
Joined
Feb 4, 2010
Messages
544
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a textbox (Textbox1) which I want to hit a command button (Update) and have it remove the last two characters in Textbox1. Is this possible?

I have been trying to utilize:

Code:
strRight = Right(str, 2)

I don't know how to use that to remove those specific characters from the textbox string. Thanks for the assistance!
 

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.
I am struggling with how to apply this. I tried this:

Code:
Textbox1.Text [COLOR=#333333]= left(str,len(str)-2)[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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