• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Remove Empty Space

Hi,
I'd like to have the empty space between 2 words removed in VBA. I'm using Excel 2013 and working on an application using a UserForm. Users make selection from a Combo box which displays in a text box on the same form. The text box should display the word by removing empty space between them.
Does someone know how to do this ??
Appreciate all help. Thanks.
Regards,
Maneesh
 
Maneesh

Try some code like:

Code:
Private Sub TextBox1_AfterUpdate()
 TextBox2.Text = Replace(TextBox1.Text, " ", "")
End Sub

Replace Textbox1 with the source string and Textbox2 with the TextBox name you are using
 
Maneesh

Try some code like:

Code:
Private Sub TextBox1_AfterUpdate()
TextBox2.Text = Replace(TextBox1.Text, " ", "")
End Sub

Replace Textbox1 with the source string and Textbox2 with the TextBox name you are using
Hi Hui,
Thanks for helping me out !! Your code works wonderfully !!!
 
Back
Top