View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
right justified and zero filled (excel)[_2_] right justified  and zero filled (excel)[_2_] is offline
external usenet poster
 
Posts: 2
Default format a right justified zero filled field to a prn file


....&text(a1*100,rept(0,10))&... will do. I found out the "paste special
format" from another cell with custom format of "0000000000" is doing the job
as well. Thanks for the solutions.

"Dave Peterson" wrote:

Saved from a previous post:

You could concatenate the cell values into another column:

=LEFT(A1&REPT(" ",5),5) & LEFT(B1&REPT(" ",4),4) & TEXT(C1,"000,000.00")

(You'll have to modify it to match what you want.)

Drag it down the column to get all that fixed width stuff.

Then I'd copy and paste to notepad and save from there. Once I figured out that
ugly formula, I kept it and just unhide that column when I wanted to export the
data.

If that doesn't work for you, maybe you could do it with a macro.

Here's a link that provides a macro:
http://google.com/groups?threadm=015...0a% 40phx.gbl

===============
You may need something like:

...&text(a1*100,rept(0,10))&...

right justified and zero filled (excel) wrote:

I need to save the excel file to a PRN file. One of the fields, according to
the spec, is a numeric filed (check amount), right aligned and zero filled
for total 10 characters in length. (0000010050 for $100.50) Would you have an
advice on the formatting?


--

Dave Peterson