Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Removing space characters

To Whom it may concern,

I am using Excel 2003 to create reports from ISPF *.csv files. Due to the
type of dataset I'm using, many of the cells will contain space characters
that I will want to delete. For the majority of the report, a simple
"Replace" code will work well, but there are some cells that need only the
space characters on the left removed. Also, the length of data that needs
to be reported varies dramatically. So, how can I format the text in a cell
so that all of the spaces within the text remain, and those on the left of
the last character are removed?


TIA
Andrew from Telstra


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Removing space characters

I am using Excel 2003 to create reports from ISPF *.csv files. Due to the
type of dataset I'm using, many of the cells will contain space characters
that I will want to delete. For the majority of the report, a simple
"Replace" code will work well, but there are some cells that need only the
space characters on the left removed. Also, the length of data that needs
to be reported varies dramatically. So, how can I format the text in a
cell so that all of the spaces within the text remain, and those on the
left of the last character are removed?


Since you asked in the programming newsgroup, I assume you want a VBA
answer... look up the LTrim function in the help files.

Rick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Removing space characters


"spaces within the text remain, and those on the left of
the last character are removed"

Sub RoundEmUp()
'Jim Cone - San Francisco - July 2007
Dim strPart As String
Dim strText As String

strText = Range("B5").Text
strPart = Right$(strText, 2)

Do While Asc(strPart) = 32
strText = Left$(strText, Len(strText) - 2)
strPart = Right$(strPart, 1)
strText = strText & strPart
strPart = Right$(strText, 2)
Loop
Range("B5").Value = strText
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Andrew@Telstra"

wrote in message
To Whom it may concern,

I am using Excel 2003 to create reports from ISPF *.csv files. Due to the
type of dataset I'm using, many of the cells will contain space characters
that I will want to delete. For the majority of the report, a simple
"Replace" code will work well, but there are some cells that need only the
space characters on the left removed. Also, the length of data that needs
to be reported varies dramatically. So, how can I format the text in a cell
so that all of the spaces within the text remain, and those on the left of
the last character are removed?
TIA
Andrew from Telstra


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
Removing Space James8309 Excel Worksheet Functions 1 June 18th 08 02:04 AM
Removing Space Tom Excel Worksheet Functions 7 February 26th 07 09:05 PM
Removing Space KL Cheong Excel Discussion (Misc queries) 7 April 28th 06 07:32 AM
Removing a space within a cell JERRY8 Excel Worksheet Functions 3 December 2nd 04 03:22 AM
Removing special characters and extra white space dougmcc1 Excel Programming 5 June 24th 04 01:27 AM


All times are GMT +1. The time now is 08:51 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"