ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Adding numbers or characters to existing numbers (https://www.excelbanter.com/excel-worksheet-functions/131467-adding-numbers-characters-existing-numbers.html)

Jannie

Adding numbers or characters to existing numbers
 
I have a column of numbers 005445688996
005675556543 and so on.

About 500 in all. I want to add a zero to the beginning of all the numbers.
So example the first one reads: 0005445688996 and so on down the entire
column.
Please help.
Jannie

Don Guillett

Adding numbers or characters to existing numbers
 
try this

for each c in range("a2:a"&cells(rows.count,"a").end(xlup).row))
c.value="0" & c
next c
--
Don Guillett
SalesAid Software

"Jannie" wrote in message
...
I have a column of numbers 005445688996
005675556543 and so on.

About 500 in all. I want to add a zero to the beginning of all the
numbers.
So example the first one reads: 0005445688996 and so on down the entire
column.
Please help.
Jannie




Jannie

Adding numbers or characters to existing numbers
 
My column data starts in cell C3. I tried this formula but I don't think I'm
saying it right. Could you please write it out exactly like I should say it
so I understand exactly what you mean. Thanks.

"Don Guillett" wrote:

try this

for each c in range("a2:a"&cells(rows.count,"a").end(xlup).row))
c.value="0" & c
next c
--
Don Guillett
SalesAid Software

"Jannie" wrote in message
...
I have a column of numbers 005445688996
005675556543 and so on.

About 500 in all. I want to add a zero to the beginning of all the
numbers.
So example the first one reads: 0005445688996 and so on down the entire
column.
Please help.
Jannie





Don Guillett

Adding numbers or characters to existing numbers
 
This is NOT a formula. It is a macro that must be copied into a module and
executed.

Just tested. Notice the ' before the 0

Sub addzerotostartofcell()
For Each c In Range("c3:c" & _
Cells(Rows.Count, "c").End(xlUp).Row)
c.Value = "'0" & c
Next c


--
Don Guillett
SalesAid Software

"Jannie" wrote in message
...
My column data starts in cell C3. I tried this formula but I don't think
I'm
saying it right. Could you please write it out exactly like I should say
it
so I understand exactly what you mean. Thanks.

"Don Guillett" wrote:

try this

for each c in range("a2:a"&cells(rows.count,"a").end(xlup).row))
c.value="0" & c
next c
--
Don Guillett
SalesAid Software

"Jannie" wrote in message
...
I have a column of numbers 005445688996
005675556543 and so on.

About 500 in all. I want to add a zero to the beginning of all the
numbers.
So example the first one reads: 0005445688996 and so on down the entire
column.
Please help.
Jannie







MartinW

Adding numbers or characters to existing numbers
 
Hi Jannie

If they are all going to be 13 digits then you could format the
cells as custom 0000000000000

HTH
Martin



Jannie

Adding numbers or characters to existing numbers
 
Hi Martin:
when I try that it doesn't work because the numbers came from another source
and it doesn't recognize the numbers as values. I tried copy and paste
special to make them values but it's not working. I had to format the cells
as numbers but it drops the leading zero so I'm trying to add it back.

As far as the "macro module "thing I have never done that so I don't even
know where to start.

Isn't there an easier way for me to do this?

Jannie

"MartinW" wrote:

Hi Jannie

If they are all going to be 13 digits then you could format the
cells as custom 0000000000000

HTH
Martin




David Biddulph

Adding numbers or characters to existing numbers
 
If your existing "numbers" are text strings, then =0&A1
If your existing numbers are actually numbers, but formatted, then you may
need something like
=0&TEXT(A1,"000000000000")
--
David Biddulph

"Jannie" wrote in message
...
I have a column of numbers 005445688996
005675556543 and so on.

About 500 in all. I want to add a zero to the beginning of all the
numbers.
So example the first one reads: 0005445688996 and so on down the entire
column.
Please help.
Jannie




Don Guillett

Adding numbers or characters to existing numbers
 
In the helper column try this formula. Then copy/paste as values
="0"&c3

--
Don Guillett
SalesAid Software

"Don Guillett" wrote in message
...
This is NOT a formula. It is a macro that must be copied into a module and
executed.

Just tested. Notice the ' before the 0

Sub addzerotostartofcell()
For Each c In Range("c3:c" & _
Cells(Rows.Count, "c").End(xlUp).Row)
c.Value = "'0" & c
Next c


--
Don Guillett
SalesAid Software

"Jannie" wrote in message
...
My column data starts in cell C3. I tried this formula but I don't think
I'm
saying it right. Could you please write it out exactly like I should say
it
so I understand exactly what you mean. Thanks.

"Don Guillett" wrote:

try this

for each c in range("a2:a"&cells(rows.count,"a").end(xlup).row))
c.value="0" & c
next c
--
Don Guillett
SalesAid Software

"Jannie" wrote in message
...
I have a column of numbers 005445688996
005675556543 and so on.

About 500 in all. I want to add a zero to the beginning of all the
numbers.
So example the first one reads: 0005445688996 and so on down the
entire
column.
Please help.
Jannie








MartinW

Adding numbers or characters to existing numbers
 
Hi Jannie

< I tried copy and paste special to make them values but it's not working. I
had to format the cells

By this do you mean you copied a 'blank' cell, then selected your data, then
paste
special, check 'add' and OK.

This should convert all your data to numbers and then applying the custom
format should put all your leading zeroes in place.

HTH
Martin



Jannie

Adding numbers or characters to existing numbers
 
YES! David That worked perfect. Thank you all for helping!
Jannie

"David Biddulph" wrote:

If your existing "numbers" are text strings, then =0&A1
If your existing numbers are actually numbers, but formatted, then you may
need something like
=0&TEXT(A1,"000000000000")
--
David Biddulph

"Jannie" wrote in message
...
I have a column of numbers 005445688996
005675556543 and so on.

About 500 in all. I want to add a zero to the beginning of all the
numbers.
So example the first one reads: 0005445688996 and so on down the entire
column.
Please help.
Jannie






All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com