ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   add characters to beginning of text (https://www.excelbanter.com/excel-worksheet-functions/16077-add-characters-beginning-text.html)

Natalie

add characters to beginning of text
 
Does anyone know how to add characters to the beginning of numbers -

I have a list of numbers

51126
54889
53665

and I want

051126
054889
053665

I can't use the format cells, as I need the numbers to be text??

Thanks

Arvi Laanemets

Hi

With number p.e. in A1:
=TEXT(A1,"00000")

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Natalie" wrote in message
...
Does anyone know how to add characters to the beginning of numbers -

I have a list of numbers

51126
54889
53665

and I want

051126
054889
053665

I can't use the format cells, as I need the numbers to be text??

Thanks




Peter Rooney

Natalie,

Select the cells you want tmodify, then run this code:

Sub AddApostropheToRange()
Dim CellToModify As Object
For Each CellToModify In Selection
CellToModify.Formula = "'0" & CellToModify.Formula
Next CellToModify
End Sub

Hope this helps

Pete



"Natalie" wrote:

Does anyone know how to add characters to the beginning of numbers -

I have a list of numbers

51126
54889
53665

and I want

051126
054889
053665

I can't use the format cells, as I need the numbers to be text??

Thanks


R.VENKATARAMAN

if 51126 is ib a1 in B1 type
="0"&A1
copy this formula down

Natalie wrote in message
...
Does anyone know how to add characters to the beginning of numbers -

I have a list of numbers

51126
54889
53665

and I want

051126
054889
053665

I can't use the format cells, as I need the numbers to be text??

Thanks





All times are GMT +1. The time now is 04:44 AM.

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