Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
gh gh is offline
external usenet poster
 
Posts: 4
Default AddSpaceAfterComma

I am using Excel 97 and have a column with names Like below:

Lastname,John A

How can I get a space between the comma and firstname?

Lastname, John A

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default AddSpaceAfterComma

Sub addspaceaftercomma()
For Each c In Selection
f = InStr(c, ",")
c.Value = Left(c, f) & " " & Right(c, Len(c) - f)
Next c
End Sub


--
Don Guillett
SalesAid Software

"gh" wrote in message
...
I am using Excel 97 and have a column with names Like below:

Lastname,John A

How can I get a space between the comma and firstname?

Lastname, John A

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default AddSpaceAfterComma

The easiest way would be to do an Edit | Replace and Replace All "," with ",
" (without the quotes)

If, in some cases you already have a space, you could do another Replace All
and change two spaces to one space

Regards

Trevor


"gh" wrote in message
...
I am using Excel 97 and have a column with names Like below:

Lastname,John A

How can I get a space between the comma and firstname?

Lastname, John A

Thanks



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



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