Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Remove spaces

Hi All,

How could I remove all spaces from a text?

I have a userform with a text box. when the user input
some text there I want to get that text in to my sheet1
A1 removeing all spaes.

for eg. if the text is "This is my text" then A1 should
get "thisismytext"

any help?

TIA

Soniya
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Remove spaces

Try this...

Private Sub CommandButton1_Click()
Range("A1").Value = Replace(TextBox1.Text, " ", "")
End Sub


Soniya wrote:

Hi All,

How could I remove all spaces from a text?

I have a userform with a text box. when the user input
some text there I want to get that text in to my sheet1
A1 removeing all spaes.

for eg. if the text is "This is my text" then A1 should
get "thisismytext"

any help?

TIA

Soniya


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Remove spaces

Replace works for xl2000 onward, for all versions

Range("A1").Value = Application.Substitute(Textbox1.Text," ","")

--
Regards,
Tom Ogilvy

"Soniya" wrote in message
...
Hi All,

How could I remove all spaces from a text?

I have a userform with a text box. when the user input
some text there I want to get that text in to my sheet1
A1 removeing all spaes.

for eg. if the text is "This is my text" then A1 should
get "thisismytext"

any help?

TIA

Soniya



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove spaces phonenumbers Tromp Excel Discussion (Misc queries) 6 October 1st 09 12:05 AM
How can i remove spaces? Lion2004 Excel Discussion (Misc queries) 1 March 9th 07 11:57 AM
how do I remove leading spaces and leave the remianing spaces w Debi Excel Worksheet Functions 6 February 28th 07 03:29 PM
Remove all spaces in a cell... killertofu Excel Worksheet Functions 8 February 20th 06 08:17 PM
How do I remove spaces lovebaby Excel Discussion (Misc queries) 5 October 29th 05 02:08 PM


All times are GMT +1. The time now is 06:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"