Save with defined position

  • Thread starter Thread starter Anthony
  • Start date Start date
A

Anthony

Hello,
Would love to know if it is at all possible to save a text
file with the columns being at a set charecter distance.
For example, column B should start at 20 chareters, column
C to start at 27 charecters.
If this is not possible, is it possible to save the file
as a fixed lentgh with each column defined as a fixed
length.

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

I'd either 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.)

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]
 
When saving the file, in the 'save as type' drop down box, select "Formatted
text (space delimited)". This will pad the data with spaces where necessary
to match the column widths that you have defined for the cells.
 
Just to add to Stephen's reply.

You may want to change your font to Courier New. This is a non-proportional
spaced font and it may make it easier to see how to adjust columnwidths.
 
Back
Top