LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Code to insert a coma

I run a macro and it puts these values in cells D1 to N1. This can be longer or shorter but the format stays the same for the single letters & numbers following the word in D1 ("Abit" here).

Abit A 9 B 8 C 7 D 6 E 5

Then thecode below is called and I get this ALL IN ONE CELL, D1.
Abit A 9 B 8 C 7 D 6 E 5

Sub ConIt()
Dim i As Integer
i = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column - 3
For i = 1 To i
Range("D1").Value = Range("D1").Value & " " & Range("D1").Offset(0, i)
Next
End Sub

How can I make the code put a coma after each number EXCEPT the last number which is 5 here.

Thanks,
Howard
 
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
number seperator by coma yogi Excel Programming 2 March 8th 11 07:49 AM
Coma between two e-mails Hemang Excel Discussion (Misc queries) 3 May 13th 10 10:30 PM
Coma Separator in Numbers Procash Excel Discussion (Misc queries) 1 August 12th 07 10:08 AM
coma not separating data moinik123 Excel Discussion (Misc queries) 3 March 28th 06 06:21 AM
Indian Coma Style Shital Excel Programming 2 April 12th 04 01:46 PM


All times are GMT +1. The time now is 06:37 AM.

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"