VBA export excel to .txt, number format problem

  • Thread starter Thread starter ehflam
  • Start date Start date
E

ehflam

Hi.

I want to export some data from an Excel file to a text file usin
macros.
I can do the exporting no problem, but the numbers aren't showing a
the format a wanted (I need them to be in .00000E+00 so that my othe
program can read it)(e.g 165.2 = .16520E+03).

Right now, I have to change every cell to text, and then switch the
back to numbers again after writing to the text file because I don'
want to mess up the original file, which makes it extremely slow. Ar
there any ways to do this without writing to the original excel file a
all?

Thanks
 
I saved as a tab delimited text file and got this in my text file:

..16520E+03 .16520E+03 .16520E+03
..16520E+03 .16520E+03 .16520E+03


I saved as comma delimited and got this:

..16520E+03,.16520E+03,.16520E+03
..16520E+03,.16520E+03,.16520E+03

I used a custom number format of:
..00000E+00 for each cell.

When you're checking your output, don't import it back into excel. Check it in
Notepad (or your favorite text editor.)

Reimporting it into excel could be the cause of your heartache.
 

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

Back
Top