Re: Exporting Fixed Width Column ASCII Format

  • Thread starter Thread starter Dave Peterson
  • Start date Start date
D

Dave Peterson

You have a few choices (try against a copy of your worksheet):

You might be able to change the font to Courier New (a fixed width font) and
then do File|SaveAs, choose "Formatted Text (space delimited) (*.prn)" (But
that's limited to 240 characters per line--may not be important to you now.)

But I've always struggled with making the columns fit nicely.

I'd either concatenate the cell values into another column:

=LEFT(A1&REPT(" ",20),20) & LEFT(B1&REPT(" ",10),10) & TEXT(C1,"000,000.00")

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/[email protected]

(in fact, it contains most of this message!)
 
I had the same problem and am using the .prn to save the file to
transfer to the mainframe. My question to you is if you had trouble
with the end of file marker when attempting this? The fields look
good in the file but the blank lines are killing me! My program keeps
abending! (e-mail address removed)
 
I just tried it and it looks like xl2002 is pretty good at determining the last
used row.

If you hit ctrl-End, do you go way past what you expected? If yes, maybe you
could try some of the techniques at Debra Dalgleish's site to help reset that
last used cell.

http://www.contextures.com/xlfaqApp.html#Unused

If you have formulas that evaluate to "" (so they look empty), then it might be
easier to just copy the range you want and paste to a new worksheet (in a new
workbook) and save it from there.
 
Back
Top