View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default VBA export excel to .txt, number format problem

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.


ehflam wrote:

Hi.

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

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

Thanks!

--
ehflam
------------------------------------------------------------------------
ehflam's Profile: http://www.excelforum.com/member.php...o&userid=16779
View this thread: http://www.excelforum.com/showthread...hreadid=319778


--

Dave Peterson