macro cell add a comma

  • Thread starter BrianMultilLanguage
  • Start date
B

BrianMultilLanguage

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.
 
V

Vergel Adriano

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
 
J

JW

Why not just use a formula in another column and PasteSpecial-->Values
over top of the existing data once complete?
=A1 & ","
 
V

Vergel Adriano

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top