I assume you're thinking about applying "text" formatting to the cell - after the import? That won't help, because Excel actually drops the leading zeros when it stores the number, not just when it displays is.
Just been doing a little experimenting ... If you are bringing the data in by opening the text file from File/Open in Excel, you should get a Text Import Wizard popping up. That wizard allows you to designate the column that has the numbers in it, as text. Once you've done that, your leading zeros will stay on it without any need for quotes in the text file. Note that my previous reply was actually wrong. If I change the line to XYZ<tab>"000123" (i.e. put quotes round the number), the import wizard still brings it in as a number and Excel discards the leading zeros. If you're using copy/paste to move the values from the text file to the spreadsheet, you'll have pretty much the same problem. However, if you pre-format all the destination cells as text, then do the copy/paste into those preformatted cells, you'll get the right result. Dave S ----- Original Message ----- From: Green To: [email protected] Sent: Friday, July 08, 2005 9:16 PM Subject: RE: [ASP] Single quote problem Just a thought... Is it possible to "format" the excel column? Lisa Hi all, I'm creating ASP application to write into a tab-delimited file to be read by Excel. This is the requirement, don't ask me why :-) The desired output should be something like: XYZ 0002393 The problem is when I open the output file using Excel, it becomes: XYZ 2393 I know that in Excel we need to put single quote to explicitly indicate a value as a string. But when I purposely throw single quote in the ASP code, it becomes: XYZ '0002393 The single quote is also displayed! In either case, that's not the desired outcome. Is there anything I can do? thanks! [Non-text portions of this message have been removed] --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- ------------------------------------------------------------------------------ YAHOO! GROUPS LINKS a.. Visit your group "active-server-pages" on the web. b.. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. ------------------------------------------------------------------------------ [Non-text portions of this message have been removed] --------------------------------------------------------------------- Home : http://groups.yahoo.com/group/active-server-pages --------------------------------------------------------------------- Post : [email protected] Subscribe : [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] --------------------------------------------------------------------- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/active-server-pages/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
