View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim May Jim May is offline
external usenet poster
 
Posts: 477
Default Text formatted as "General" in Excel 2002. How do I avoid that?

Example,, say your numbers are in Column D
In a standard module enter:

Sub Macro1()
' Macro1 Macro
' Macro recorded 8/11/2006 by Jim May
Columns(4).NumberFormat = "00000000"
End Sub

Ans run it!!

"Anant" wrote:

I have an application that generates a file. I can give any kind of extension
name to this file generated. I have full control on output generated in this
file. Meaning, I can put quotes, single qute, tab, etc anywhere I want.

My objective is to open up this file in Excel. When I do that, some text
like "00010010" ends up becoming 10010. How do I avoid that from happening.
Note that since the file extension is already a ".xls" or a ".csv", Excel
opens it up right away, rather than going through a formatting steps that I
would normally go through for opening up a ".txt" file.

What I have tried so far is
1) "00010010"
2) '00010010'
3) '00010010
None of these produces the desired result. I would appreciate any help
provided. thanks in advance.