Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extract the text between last comma and last but one comma. | Excel Worksheet Functions | |||
Comma Delimited-need comma at beginnng & end | Excel Discussion (Misc queries) | |||
macro to add a comma | New Users to Excel | |||
Macro to Export Active Cells, Comma Sep to .txt file | Excel Programming | |||
Macro to find a comma in a string | Excel Programming |