LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Inserting and deleting spaces with a macro

Assuming the only comma and space are as indicated, this UDF should do it.

Public Function FixName(argRange As Range) As String
FixName = Replace(Split(argRange, " ")(0), ",", ", ")
End Function

You should add error checking to ensure that argRange is a single cell.

NickHK

"crowdx42" wrote in
message ...

Ok,
so I have names in a column which I want to both insert a space after
a "," and then delete everything after the second word space. i.e
James,Patrick Coogan needs to be
James, Patrick
Can this be done?
Thanks in advance
You guys have been very patient and I very much appreciate all the
help.
Patrick:)


--
crowdx42
------------------------------------------------------------------------
crowdx42's Profile:

http://www.excelforum.com/member.php...o&userid=37749
View this thread: http://www.excelforum.com/showthread...hreadid=574054



 
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
Matching names and inserting spaces ILunacy Excel Worksheet Functions 0 February 15th 10 06:15 PM
Matching names and inserting spaces ILunacy Excel Worksheet Functions 3 February 15th 10 03:17 PM
Deleting spaces GARY Excel Discussion (Misc queries) 5 August 17th 08 09:35 PM
Inserting/Deleting Spaces carl Excel Worksheet Functions 4 April 22nd 05 06:25 PM
Excel – Macro Problem – Inserting, Appending Data, Deleting Aussiexcel[_3_] Excel Programming 0 August 25th 04 07:48 AM


All times are GMT +1. The time now is 02:50 PM.

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

About Us

"It's about Microsoft Excel"