Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Return cell characters after space | Excel Worksheet Functions | |||
Inserting a space between characters in a cell | Excel Discussion (Misc queries) | |||
Insert Leading Characters If String Is Only 7 Characters | Excel Discussion (Misc queries) | |||
Put A Space Between 2 right characters | Excel Worksheet Functions | |||
cHARACTERS BEFORE THE SPACE | Excel Worksheet Functions |