Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default erase all space characters into string

Hi,

I would like to know how can i do to erase all space characters into a
string ?

i tried TRIM but it's only for left and right sides, not for inside the
string itself..

I would like to get from " this is a string ", this string "thisisastring".

should i proceed characters per character ?

thx,
Maileen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default erase all space characters into string

Date: Sun, 16 Jan 2005 11:48:01 +0100
To: Maileen
Bcc: Jan Karel Pieterse
Subject: erase all space characters into string
From: Jan Karel Pieterse

Hi Maileen,

I would like to get from " this is a string ", this string

"thisisastring".

Dim sString as String
sString=" this is a string "
sString=Replace(sString," ","")
Msgbox sString

Works for Excel 2000 and up.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default erase all space characters into string

Or use EditReplace in the Menu Bar

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jan Karel Pieterse" wrote in message ...
Date: Sun, 16 Jan 2005 11:48:01 +0100
To: Maileen
Bcc: Jan Karel Pieterse
Subject: erase all space characters into string
From: Jan Karel Pieterse

Hi Maileen,

I would like to get from " this is a string ", this string

"thisisastring".

Dim sString as String
sString=" this is a string "
sString=Replace(sString," ","")
Msgbox sString

Works for Excel 2000 and up.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 535
Default erase all space characters into string

Hi Ron,

Or use EditReplace in the Menu Bar


I assumed this was a VBA question.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default erase all space characters into string

I've also seen this used for Excel 97

Sub test()
Dim str As String

str = " this is a string "

str = WorksheetFunction.Substitute(str, " ", "")

MsgBox str
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Jan Karel Pieterse" wrote in message
...
Date: Sun, 16 Jan 2005 11:48:01 +0100
To: Maileen
Bcc: Jan Karel Pieterse
Subject: erase all space characters into string
From: Jan Karel Pieterse

Hi Maileen,

I would like to get from " this is a string ", this string

"thisisastring".

Dim sString as String
sString=" this is a string "
sString=Replace(sString," ","")
Msgbox sString

Works for Excel 2000 and up.

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com



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
Return cell characters after space Andy Excel Worksheet Functions 3 April 30th 23 12:22 PM
Inserting a space between characters in a cell mrmnz Excel Discussion (Misc queries) 5 April 2nd 23 01:55 PM
Insert Leading Characters If String Is Only 7 Characters Paperback Writer Excel Discussion (Misc queries) 2 April 21st 09 09:07 PM
Put A Space Between 2 right characters carl Excel Worksheet Functions 3 April 8th 08 05:08 PM
cHARACTERS BEFORE THE SPACE T De Villiers Excel Worksheet Functions 3 January 19th 06 01:22 AM


All times are GMT +1. The time now is 05:25 PM.

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"