Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default macro cell add a comma

I need to add a comma at the end of every cell entry in one column and am
not having any success doing it.
It's gotta be easy for someone.
Help.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default macro cell add a comma

maybe something like this:

Sub test()
Dim c As Range
For Each c In Range("A1:A10").Cells
If c.HasFormula Then
c.Formula = c.Formula & " & "","""
Else
c.Value = c.Value & ","
End If
Next c
End Sub

--
Hope that helps.

Vergel Adriano


"BrianMultilLanguage" wrote:

I need to add a comma at the end of every cell entry in one column and am
not having any success doing it.
It's gotta be easy for someone.
Help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default macro cell add a comma

Why not just use a formula in another column and PasteSpecial--Values
over top of the existing data once complete?
=A1 & ","
Vergel Adriano wrote:
maybe something like this:

Sub test()
Dim c As Range
For Each c In Range("A1:A10").Cells
If c.HasFormula Then
c.Formula = c.Formula & " & "","""
Else
c.Value = c.Value & ","
End If
Next c
End Sub

--
Hope that helps.

Vergel Adriano


"BrianMultilLanguage" wrote:

I need to add a comma at the end of every cell entry in one column and am
not having any success doing it.
It's gotta be easy for someone.
Help.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default macro cell add a comma

I assumed the OP was looking for a VBA solution because he posted his
question here... it can be done without using VBA, but I guess problems would
occur if the cell that needed a comma was the result of a formula. doing
PasteSpecial-Values would overwrite the formula.


--
Hope that helps.

Vergel Adriano


"JW" wrote:

Why not just use a formula in another column and PasteSpecial--Values
over top of the existing data once complete?
=A1 & ","
Vergel Adriano wrote:
maybe something like this:

Sub test()
Dim c As Range
For Each c In Range("A1:A10").Cells
If c.HasFormula Then
c.Formula = c.Formula & " & "","""
Else
c.Value = c.Value & ","
End If
Next c
End Sub

--
Hope that helps.

Vergel Adriano


"BrianMultilLanguage" wrote:

I need to add a comma at the end of every cell entry in one column and am
not having any success doing it.
It's gotta be easy for someone.
Help.





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
Extract the text between last comma and last but one comma. Sreedevi Excel Worksheet Functions 2 March 5th 08 11:12 PM
Comma Delimited-need comma at beginnng & end Tattoo Excel Discussion (Misc queries) 2 December 11th 07 04:39 PM
macro to add a comma BrianMultilLanguage New Users to Excel 4 September 19th 07 06:45 PM
Macro to Export Active Cells, Comma Sep to .txt file Stryves Excel Programming 2 July 11th 06 05:34 PM
Macro to find a comma in a string Chuck[_11_] Excel Programming 8 August 24th 05 03:23 AM


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