add characters to beginning of text

N

Natalie

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
 
P

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
 

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