ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Text formatted as "General" in Excel 2002. How do I avoid that? (https://www.excelbanter.com/excel-discussion-misc-queries/104581-text-formatted-general-excel-2002-how-do-i-avoid.html)

Anant

Text formatted as "General" in Excel 2002. How do I avoid that?
 
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.

Jim May

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.


[email protected]

Text formatted as "General" in Excel 2002. How do I avoid that?
 
Or, just change the file extension to .txt and use the wizard.

Jim May wrote:
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.



Anant

Text formatted as "General" in Excel 2002. How do I avoid that
 
Please note that I would not be doing anything in Excel. The file that I
prepare in a separate application is sent out via email as an attachment. And
all I expect the receiver at the other end to do is to open this attachment
which has ".xls" or ".csv" extension. And hopefully Excel opens it up fine.
Only problem I face is that my text "00010010" ends up becoming a "10010"
when opened up. So right now I am playing around with different way of
putting this text "00010010", for e.g. single quote, double quote, etc. Any
idea to achieve my objective?

"Jim May" wrote:

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.


Anant

Text formatted as "General" in Excel 2002. How do I avoid that
 
Hello Chris,
Thank you for your post. Yes, ".txt" would be an easy way out. But
unfortunately, I am doing this for few users, to whom, that would be too much
to ask. Note that I am sending the file I generate as an email. So, all they
would want to do at their end is to click on the attachment and be formatted
right in Excel. If the attachment had a ".txt" extension, they would have to
save that file, then open it with excel and ofcourse use the format wizard
and all.

" wrote:

Or, just change the file extension to .txt and use the wizard.

Jim May wrote:
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.





All times are GMT +1. The time now is 06:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com