We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to format a Excel cell to category "Text"

Thread ID:





20547 Oct 20,2004 06:01 PM UTC Oct 20,2004 06:52 PM UTC WinForms 1
Tags: XlsIO
Dongping Tu
Asked On October 20, 2004 06:01 PM UTC

I have a very large number 210020410200001008 in one of the cells, when it got exported to Excel, it gets truncated to 210020410200001000 (NOTE that the last digit become 0 from 8) I check the cell NumberFormat from Excel, it''s defaulted to Generic, how can I change the NumberFormat from Generic to category Text which Excel will display the the cell exactly as entered even the text indeed is a number? Any help will be greatly appreciated!

Dongping Tu
Replied On October 20, 2004 06:52 PM UTC

Never mind. I figured out the solution. Just need to add the following line: sheet.Range[i+1,j+1].Text = grid[i,j].Text; to change the default Generic NumberFormat to category "Text" format. Regards


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon