# Microsoft Office Application Help - Excel Help forum > Excel Programming / VBA / Macros >  > [SOLVED] adding a single quote and comma to every cell in Excel

## rodsheffield

I need to make a script where I can add a single quote to the number in each
cell in Excel and after the second quote a comma. Hence the cell would start
like

08558952

and afterwards would look like,

'08558952',

I can't quite seem to get it done, any ideas?

TIA,

Rod

----------


## Gary Keramidas

you don't mention whether you have the loop or not, but this formula will
work, just loop through the cells

ActiveCell.Value = "'" & ActiveCell.Value & "',"

--


Gary


"rodsheffield" <rodsheffield@discussions.microsoft.com> wrote in message
news:0C87E571-A1A1-4080-BB49-0DE6941977AE@microsoft.com...
>I need to make a script where I can add a single quote to the number in
>each
> cell in Excel and after the second quote a comma. Hence the cell would
> start
> like
>
> 08558952
>
> and afterwards would look like,
>
> '08558952',
>
> I can't quite seem to get it done, any ideas?
>
> TIA,
>
> Rod

----------


## rodsheffield

Gary,

Actually no I don't have a loop in place. What are you suggesting code wise?

Thanks again for your help.

"Gary Keramidas" wrote:

> you don't mention whether you have the loop or not, but this formula will
> work, just loop through the cells
>
> ActiveCell.Value = "'" & ActiveCell.Value & "',"
>
> --
>
>
> Gary
>
>
> "rodsheffield" <rodsheffield@discussions.microsoft.com> wrote in message
> news:0C87E571-A1A1-4080-BB49-0DE6941977AE@microsoft.com...
> >I need to make a script where I can add a single quote to the number in
> >each
> > cell in Excel and after the second quote a comma. Hence the cell would
> > start
> > like
> >
> > 08558952
> >
> > and afterwards would look like,
> >
> > '08558952',
> >
> > I can't quite seem to get it done, any ideas?
> >
> > TIA,
> >
> > Rod
>
>
>

----------


## Gary Keramidas

why don't you email me what you have

--


Gary


"rodsheffield" <rodsheffield@discussions.microsoft.com> wrote in message
news:2E78E698-262D-4E3F-876A-6EA6AD11F65F@microsoft.com...
> Gary,
>
> Actually no I don't have a loop in place. What are you suggesting code
> wise?
>
> Thanks again for your help.
>
> "Gary Keramidas" wrote:
>
>> you don't mention whether you have the loop or not, but this formula will
>> work, just loop through the cells
>>
>> ActiveCell.Value = "'" & ActiveCell.Value & "',"
>>
>> --
>>
>>
>> Gary
>>
>>
>> "rodsheffield" <rodsheffield@discussions.microsoft.com> wrote in message
>> news:0C87E571-A1A1-4080-BB49-0DE6941977AE@microsoft.com...
>> >I need to make a script where I can add a single quote to the number in
>> >each
>> > cell in Excel and after the second quote a comma. Hence the cell would
>> > start
>> > like
>> >
>> > 08558952
>> >
>> > and afterwards would look like,
>> >
>> > '08558952',
>> >
>> > I can't quite seem to get it done, any ideas?
>> >
>> > TIA,
>> >
>> > Rod
>>
>>
>>

----------

