Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
DebbieK9
 
Posts: n/a
Default Removing a space after a comma

I need to create a formula that removes a space after a comma, that separates
two names, in a cell?
  #2   Report Post  
gls858
 
Posts: n/a
Default

DebbieK9 wrote:
I need to create a formula that removes a space after a comma, that separates
two names, in a cell?

Assuming that the names you refer to are in the format Smith, John and both
are in the same cell. You might consider using the text to columns feature,
Data Text to Columns, and split the cell into three columns one
containing Last Name, one for the comma, and one for the First Name, then
just delete the column with the comma. Probably best to have separate
fields for first and last names anyway.

gls858
  #3   Report Post  
 
Posts: n/a
Default

Hi

You could do it with a Find/Replace to do it in situ. If you want the result
putting in another cell, have a look at the SUBSTITUTE function.
Hope this helps.

--
Andy.


"DebbieK9" wrote in message
...
I need to create a formula that removes a space after a comma, that
separates
two names, in a cell?



  #4   Report Post  
David McRitchie
 
Posts: n/a
Default

Hi Debbie,

REPLACE Worksheet Formula
SUBSTITUTE(text, old_text, new_text, instance_num)

=SUBSTITUTE(A1, ", ", ",")

VBA for a range, several examples
Activesheet.Columns("A").Replace(What, Replacement, LookAt, _
SearchOrder, MatchCase, MatchByte) '--replace method

rng.Replace what:= ", ", replacement:= ",", _
lookat:=xlPart, searchorder:=xlByRows, MatchCase:=False
Intersect(Selection, Selection.SpecialCells(xlConstants, _ xlTextValues)).replace(", ",",")
More information or examples in
http://www.mvps.org/dmcritchie/excel/strings.htm
http://www.mvps.org/dmcritchie/excel/proper.htm
in combination with your Excel HELP and your VBA HELP

--
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"DebbieK9" wrote in message ...
I need to create a formula that removes a space after a comma, that separates
two names, in a cell?



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
Comma is not visible in Excel DrNASA Excel Discussion (Misc queries) 1 March 10th 05 05:51 PM
space between text strings with concatenate Jeff Excel Discussion (Misc queries) 2 March 3rd 05 07:54 PM
Trim function doesn't clean out ASCII Code 160 (Space) Ronald Dodge Excel Worksheet Functions 6 January 27th 05 04:48 AM
HELP - I need to change space delimited to comma? Mayer Excel Discussion (Misc queries) 1 December 18th 04 07:21 PM
Removing a space within a cell JERRY8 Excel Worksheet Functions 3 December 2nd 04 04:22 AM


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