Custom number format

D

Dave

Hello.

At work we have an application that creates .csv files that we open with
Excel. This list icludes product nubers that are ten digits long, many of
which start with one or more zeros. For legibility I would like all of the
numbers to show leading zeros if they have them. So I create a custom format
of ten zeros (i.e. 0000000000). This works great, but the format is only in
that workbook. Is there a way to create this custom format and have it
always be available even when a new notebook is opened insted of having to
re-create it every time?
If so, can it be assigned to a new toolbutton on the toolbar with the other
formatting buttons (eg. $ , % ,etc.) ? That would be even better.

TIA
Dave
 
D

Dave

Dave said:
Hello.

At work we have an application that creates .csv files that we open with
Excel. This list icludes product nubers that are ten digits long, many of
which start with one or more zeros. For legibility I would like all of the
numbers to show leading zeros if they have them. So I create a custom format
of ten zeros (i.e. 0000000000). This works great, but the format is only in
that workbook. Is there a way to create this custom format and have it
always be available even when a new notebook is opened insted of having to
re-create it every time?
If so, can it be assigned to a new toolbutton on the toolbar with the other
formatting buttons (eg. $ , % ,etc.) ? That would be even better.

TIA
Dave
Sorry, I forgot to mention....
Excel 2000
Microsoft Office
WinNT 4
 
J

J.E. McGimpsey

Create a clean workbook the way you want it, including the custom
format. Save it as a template in your XLStart directory with the
name "Book.xlt". From then on, all new workbooks will use that as
their template, and will include the custom format.

You can add a button to a toolbar using Tools/Customize. Assign a
macro to it that you store in your Personal.xls workbook:

Public Sub TenDigits()
Selection.NumberFormat = "0000000000"
End Sub


Alternatively, unless you're doing math on your product numbers, you
could use the Text wizard to bring the file in with the product
number field as text (to do this, you may need to give your files a
..txt extension rather than .csv). And of course, that could also be
automated using a macro.
 
D

Dave

Added the button to the toolbar today. It works great. Much quicker than
going through the dialogue box and entering the format each time.

Thanks again.
Dave
 

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